Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

List not found error

 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
Im trying to develop a CRUD application using JSP's and javabeans , as a start to that I have to use a jstl tag to populate a dropdown box from the database . Im using 2 bean classes and the list is loaded from a particular table. Im trying to store the values that i obtain from the query into a list and then retreive them . Im relative newbie to programming so any help would be appreciated.Thanks!!
My DAO Class.

JSP file.

My error is..
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.el.JspPropertyNotFoundException: /Main.jsp(16,8) '${domaintype.dtList}' Property 'dtList' not found on type com.jspcrud.dao.DAO
at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:104)
at org.apache.jsp.Main_jsp._jspx_meth_c_005fforEach_005f0(Main_jsp.java:124)
at org.apache.jsp.Main_jsp._jspService(Main_jsp.java:96)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

Any help would be much appreciated .
 
Mike Zal
Ranch Hand
Posts: 144
Fedora Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like your DAO class needs a getDtList() and setDtList() methods
 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mike,
Thanks for replying . I changed my DAO class to somewhat like what you said , but the error persists . Am i missing something more glaring?Please help
The modified code is as below.
 
Mike Zal
Ranch Hand
Posts: 144
Fedora Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you still getting the same error as before? The original error seemed like it was because of invalid EL.

Looking at the code more closely, you might want to consider using a custom tag. Example

Edit: You cannot call the property if it is a static method. You would need to use static el function calls. See here for more I still think you should be using a custom tag.
 
Robin John
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can keep the old method name 'loadDomainType' and create "getters and setters" for the variable named "dtList" and move the declaration "Arraylist dtList" outside the method to make it an instance variable.
 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks , I solved the problem , it was typos.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic