• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

List not found error

 
Ranch Hand
Posts: 477
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Ranch Hand
Posts: 144
Oracle Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Oracle Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks , I solved the problem , it was typos.
 
The government thinks you are too stupid to make your own lightbulb choices. But this tiny ad thinks you are smart:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic