javax.el.PropertyNotFoundException: Property 'fact' not found on type web.entity.DBData というエラーが消えません。 どなたか助けて頂けないでしょうか。 エンティティーで宣言しているのに、jspが読み込んでくれません。 [show.jsp] 表示箇所 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> <%@page import="web.entity.DBData"%> Searching
[search] データ取得 public class Search extends HttpServlet { private static final long serialVersionUID = 1L; protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Connection connection = null; try { InitialContext initCtx = new InitialContext(); DataSource ds = (DataSource) initCtx .lookup("java:comp/env/jdbc/localDB"); connection = ds.getConnection(); List resultList3 = SelectFactory(connection); request.setAttribute("list3", resultList3); request.getRequestDispatcher("/show.jsp") .forward(request, response); } catch (Exception e) { throw new ServletException(e); } finally { try { connection.close(); } catch (SQLException e) { throw new ServletException(e); } } } public List SelectFactory(Connection connection) throws Exception { String sql_Factory = "SELECT Factory_Name , General_Contractor " + "FROM FACTORY WHERE Company_Name like CONCAT('%',?,'%')"; PreparedStatement statement3 = connection.prepareStatement(sql_Factory); statement3.setString(1, "Company1"); ResultSet rs3 = statement3.executeQuery(); List resultList3 = new ArrayList(); while (rs3.next()) { DBData factory = new DBData(); factory.setFactory(rs3.getString("Factory_Name")); factory.setGcontractor(rs3.getString("General_Contractor")); resultList3.add(factory); } return resultList3; } : [DBData.java] エンティティー箇所 public class DBData { String company; String fact; String gcon; public String getFactory() { return fact; } public void setFactory(String fac) { this.fact = fac; } public String getGcontractor() { return gcon; } public void setGcontractor(String gc) { this.gcon = gc; } }
↧