wood burning stoves 2.0*
The moose likes Struts and the fly likes Cannot find bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Cannot find bean "" in scope request" Watch "Cannot find bean "" in scope request" New topic
Author

Cannot find bean "" in scope request

Rahul Ratnakar
Greenhorn

Joined: Sep 21, 2003
Posts: 2
Am facing a problem with the define tag .
In the piece of code below
<beanefine id="someID"
name="someName"
type="com.custom.somePackage.BeanClassName"
scope="request"
toScope="request"/>
the bean by the name "someName" is not expected to be in the request when the page is displayed for the first time. So this code gives me the error
"Cannot find bean someName in scope request" .
In the page however , i am always using the logic:present tag to access this bean , so as no null pointers can be expected .
According to my understanding this code is simply a declaration for the bean and shud not crib in case the bean is not there in the request scope .
I must be wrong here... but why am not sure ....

Any way am running the code by replacing the above pc with
BeanClassName someID = (BeanClassName)request.getAttribute("someName");
which is working , but it defeats the very purpose of using Struts.
Any help on why am having this issue and how to strutitize my code ?
[ edited to disable smilies -ds ]
[ April 16, 2004: Message edited by: Dirk Schreckmann ]
 
Consider Paul's rocket mass heater.
 
subject: Cannot find bean "" in scope request
 
Similar Threads
bean:define cannot instaniate new bean?
Frustration with useBean and setProperty
Doubt with <jsp:useBean> having only type no class attribute
session scopt problem
JSP:Include question