• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

html:messages

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In following code the <bean:write> tag fails with message: "org.apache.jasper.JasperException: Cannot find bean error in any scope "

<logic:messagesPresent>
<UL>
<html:messages id="error">
<LI><bean:write name="error" /></LI>
</html:messages>
</UL>
</logic:messagesPresent>
I thought this was faily standard code to display messages. Did I miss something?
Thanks for any hints,
Rich
 
Rich Smyth
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To answer my own question.
The code I posted was OK. The problem was that one of the keys used to create an ActionError had a typo and therefore did not exist in my resource bundle.
The <html:messsages> tag will set the variable defined by the tag's 'id' attribute ("error" in my case)to null if it cannot find the key in the resources. In such a case bean 'error' cannot be found because it has been set to null.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had the same problem and have spent 3 days trying to solve it. Thanks to Rich for pointing me in the right direction.

My problem was complicated because I was using the Commons Validator.
For the benefit of anyone else who has the same problem, you have to ensure not only that the keys associated with the field in the form are correctly set, but also the resource key associated with the particular validator (in my case, "required" needs a key "errors.required").

Jim.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai Rich Smyth ,

i got the same Error as u got . i'm trying for 5 days but i can't able to get the result. if there is any solution tell me [email protected]







by
dhana
[ December 05, 2004: Message edited by: dhana sss ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a ton!! I spent a few hours pulling my hair over the same issue. But of course, it was a typo in one of the resource keys!!!
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rich,
This is sham, iam confused with what your actually trying to explain in the Ans to you Q? so you could explain it with some could Ill try to get grasp. Ill be thankful for your response.


regards
sham
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic