• 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

Cannot find bean "" in scope request

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Am facing a problem with the define tag .
In the piece of code below
<bean:Define 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic