aspose file tools*
The moose likes JSP and the fly likes List not found error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "List not found error" Watch "List not found error" New topic
Author

List not found error

Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

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 .

Learning and Learning!-- Java all the way!
Mike Zal
Ranch Hand

Joined: May 04, 2011
Posts: 144

It looks like your DAO class needs a getDtList() and setDtList() methods


OCJP6, OCWCD5
Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

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

Joined: May 04, 2011
Posts: 144

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

Joined: Sep 10, 2008
Posts: 270

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.


Time is what we want the most, but what we use the worst. -- William Penn
Vic Hood
Ranch Hand

Joined: Jan 05, 2011
Posts: 477

Thanks , I solved the problem , it was typos.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: List not found error