wood burning stoves 2.0*
The moose likes Struts and the fly likes Can not show the ActionMessages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Can not show the ActionMessages" Watch "Can not show the ActionMessages" New topic
Author

Can not show the ActionMessages

Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 229
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.

Thanks in Advance,
Kousik
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

You've to check whether message present in scope or not, like


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 229
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

Joined: Feb 19, 2008
Posts: 2902
    
    1

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

Joined: Sep 30, 2007
Posts: 229
Yes, I have used the correct tag.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

I'll debug:
Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 229
[color=red] [/color]

No Sagar...it is still giving the same error............
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

"name" should be "ok":
Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 229
ya....I have done it already.....this was just experimenting.................

One more thing...I am using struts 1.2....
Kousik Majumder
Ranch Hand

Joined: Sep 30, 2007
Posts: 229
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

Joined: Feb 19, 2008
Posts: 2902
    
    1

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Can not show the ActionMessages
 
Similar Threads
Record inserted successfully problem
ActionMessage not iterating
ActionMessage is not working
html:messages
ActionMessages?????????