• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

html:messages

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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 .dhana_java@yahoo.com







by
dhana
[ December 05, 2004: Message edited by: dhana sss ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
    Bookmark Topic Watch Topic
  • New Topic