Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can not show the ActionMessages

 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Action class:-


.jsp:-

Error:-


Can somebody tell me that what to give in id attribute of html:messages tag and how to configure for that.
Please help.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You've to check whether message present in scope or not, like
 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No...still it is not working...it is giving the same error........
Can you please tell the id attribute of html:messages.
In Spec it is written "The name of a page scope JSP bean that will contain the current element of the collection of messages on each iteration, if it is not null. [Required]"


What does that mean?
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kousik Majumder wrote:No...still it is not working...it is giving the same error........

Have you tried with the correct tag, I misspelled it, correct one:
 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I have used the correct tag.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll debug:
 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[color=red] [/color]

No Sagar...it is still giving the same error............
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"name" should be "ok":
 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya....I have done it already.....this was just experimenting.................

One more thing...I am using struts 1.2....
 
Kousik Majumder
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the problem is resolved if I use


But in this case the message is not showing. ...............'i m here' is getting shown......but the message from MessageResources.properties file is not getting shown.........
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're using the saveMessages(..), so <html:erorrs../> will be of no use. Try this link:
http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html#section4

Also post the action mapping for the same action.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic