Hi,
I have a web app that uses jsps.
I have a database to store a 'users' table and a 'cars' table
i have 2 pages, one to view all the cars and one to view all the users.
The code for the two is near identical apart from the database table entities.
The 'viewcars.jsp' works perfect and displays everything
but the 'viewusers.jsp' page gives the following error in Netbeans
However, if i remove the first field in the DB from showing in the JSP (i.e. the 'userid' field, the error goes away and the list will display fineCode:javax.servlet.ServletException: org.apache.jasper.el.JspPropertyNotFoundException: /viewUsers.jsp(76,36) '#{users.userid}' Property 'userid' not found on type business.User javax.faces.webapp.FacesServlet.service(FacesServlet.java:256) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390) users - is the array to hold the users userid - is the field for the userid
Below is the JSP that manages the 'viewusers' page.
ie. in the above code, if i remove the userid fields, the page will load fine.Code:<%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%-- This file is an entry point for JavaServer Faces application. --%> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>View Users</title> <link href="../css/mystyles.css" rel="stylesheet" media="screen"/> </head> <body> <f:view> <h:form> <div id="header"> <f:subview id="header" > <jsp:include page="header.jsp"/> </f:subview> </div> <div id="menu"> <f:subview id="menu"> <jsp:include page="menu.jsp"/> </f:subview> </div> <div id="container"> <div id="content"> <h:form> <h:dataTable value="#{UserBean.users}" var="users" styleClass="users" headerClass="usersHeader" columnClasses="column1,column2,column3" rowClasses="oddRow,evenRow"> <h:column> <f:facet name="header"> <h:outputText value="User ID" /> </f:facet> <h:outputText value="#{users.userid}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Password" /> </f:facet> <h:outputText value="#{users.password}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Email" /> </f:facet> <h:outputText value="#{users.email}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Name" /> </f:facet> <h:outputText value="#{users.name}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Contact" /> </f:facet> <h:outputText value="#{users.contact}" /> </h:column> <h:column> <f:facet name="header"> <h:outputText value="Balance" /> </f:facet> <h:outputText value="#{users.balance}" /> </h:column> </h:dataTable> </h:form> </div> </div> <div id="footer"> <f:subview id="footer"> <jsp:include page="/footer.jsp"/> </f:subview> </div> </h:form> </f:view> </body> </html>
The test of the method used to find and display all the users works fine even with the userid but its when it goes to translate it into the JSP something goes wrong
Anyone any ideas?
Thanks


LinkBack URL
About LinkBacks




Reply With Quote

Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum