• 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

wsad 5.1 usebean not compiled correctly

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My understanding is that the jsp:usebean tag should instantiate a bean if it can not find it. However the code generated from jps in wsad 5.1 throws an execption in that case. Is this wrong or am I misunderstanding. I came across this after I realized that usebean tags failed unless I used the IDE to generate them.


// end
// begin [file="/iteratorTest.jsp";from=(25,0);to=(26,53)]
test.stubs.iterator.TestList tableTest = null;
boolean _jspx_specialtableTest = false;
synchronized (session) {
tableTest= (test.stubs.iterator.TestList)
pageContext.getAttribute("tableTest",PageContext.SESSION_SCOPE);
if (tableTest == null)
throw new java.lang.InstantiationException ("bean tableTest not found within scope ");
}
if(_jspx_specialtableTest == true) {
// end
// HTML // begin [file="/iteratorTest.jsp";from=(26,53);to=(27,0)]
out.write("\r\n");
 
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've run into this before, too. Basically, it's a misunderstanding of which attributes to specify on the useBean tag -- which, since I've run into it too, I have to say is completely understandable!

In order for it to actually instantiate it, make sure that your useBean tag specifies the class attribute. Type alone doesn't cut it. Here's the key...

"If you use type without class or beanName, no bean is instantiated. The package and class name are case sensitive."

@see the JSP syntax ref : http://java.sun.com/products/jsp/syntax/1.2/syntaxref1217.html#8865
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic