• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem using javabean in JSP

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everbody!
I have used JavaBean as arraylist and hardcoded some values in the servlet. I am now trying to show those JavaBean values through JSP to the user. my code in JSP is:
<jsp:useBean id="qb" class="QuoteBean"/>
// I think default scope=page, so didnt mention
<jsp:setProperty name="qb" property="*"/>
When I execute JSP page, the error i get is : QuoteBean qb = null.
Can anybody pls help figuring out the problem.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most Application Servers don't like Beans that are not packaged. So it could be a couple of things.
1. You need to put your bean in a package (ie. com.mypackage.QuoteBean)
2. You have your bean in a package but you failed to list it that way in the JSP tag. You tag would look like:

[ October 19, 2003: Message edited by: Gregg Bolinger ]
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Gregg, thanks a lot for your valuable advice! It solved my problem!
reply
    Bookmark Topic Watch Topic
  • New Topic