wood burning stoves 2.0
The moose likes JSP and the fly likes Problems with  jsp:useBean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Problems with  jsp:useBean" Watch "Problems with  jsp:useBean" New topic

Problems with jsp:useBean

Rafael Afonso
Ranch Hand

Joined: Jul 16, 2002
Posts: 63
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?

=================================<br /> Rafael U. C. Afonso<br /> <a href="http://www.javafree.com.br" target="_blank" rel="nofollow">www.javafree.com.br</a><br />=================================<br /><i>Where is debug?<br />debug is on the table</i>
Mark Howard
Ranch Hand

Joined: Feb 14, 2001
Posts: 285
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
I agree. Here's the link: http://aspose.com/file-tools
subject: Problems with jsp:useBean
It's not a secret anymore!