Two Laptop Bag
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Cannot find bean "" in scope request" Watch "Cannot find bean "" in scope request" New topic

Cannot find bean "" in scope request

Rahul Ratnakar

Joined: Sep 21, 2003
Posts: 2
Am facing a problem with the define tag .
In the piece of code below
<beanefine id="someID"
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 ]
I agree. Here's the link:
subject: Cannot find bean "" in scope request
It's not a secret anymore!