• 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

Problems with jsp:useBean

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello:
In a JSP Page I created one bean as String and I defined its value of the following form:

When I go to open the page, appear the following message of the Tomcat:


javax.servlet.ServletException: bean stringSearch not found within scope


Analyzing .java generated from my JSP I observed the following one I break up of code:

This means that a value to bean was not atribuited. What I am doing wrong? The fact of String to be a final class and not to exist something as String.setValue() influences?
Grateful,
 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rafael
Chewed on this one for a while, until I noticed that you only specify type in your bean declaration. Type can not be specified on its own if the bean has not been instantiated yet. You must add either class or beanName as well.
Once instantiated, any further useBean declarations for the same bean variable, using only type, should work ok.
Hope this helps
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic