File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How to remove auto message... struts2. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to remove auto message... struts2." Watch "How to remove auto message... struts2." New topic
Author

How to remove auto message... struts2.

victor chiong
Ranch Hand

Joined: Apr 04, 2012
Posts: 73
Hi Guys,

How to remove the auto messages? I have already put these fields. <s:actionerror /> and <s:fielderror />. Howerver when error is triggered on the validate() method.. my error message will pop up on the <s:actionerror /><s:fielderror />. However the messages would also popout above my fields... I want to remove the messages on top of my fields.. How can i do this? I am stock guys..

Thanks,
Victor
victor chiong
Ranch Hand

Joined: Apr 04, 2012
Posts: 73
please help?



LOT MOVEMENT

*UserID must not be blanks
*Password must not be blanks


UserID must not be blanks ---> I want to remove this one because i already has an error message above.
UserName:

Password must not be blanks--->I want to remove this one because i already has an error message above.
Password:
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi Victor,

The messages which are coming on top of your page is coming from validate method which returns the actionerror and those error are displayed on jsp as you have mentioned <s:actionerror />.
remove <s:actionerror> through which you can remove the mesages top of the page.

Validate method in actionform is server side validation which you should keep and i advise you to remove the javascript validation.

Regards
Jatan

victor chiong
Ranch Hand

Joined: Apr 04, 2012
Posts: 73
Hi,

Thanks for the advice

"Validate method in actionform is server side validation which you should keep and i advise you to remove the javascript validation. " -- any reason? I decided to use the action error because it looks good? it does not destroy the allignment of the fields... I want to know your reason because I am new to this world of struts.

Thanks,
Vic
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

If you want to get rid of the error messages at the top of the page, remove the <s:actionerror /> tag. I think this is what Jatan is talking about.
If you want to get rid of the messages next to your fields, you have to use the "simple" tag theme. This is explained in this FAQ entry and the default theme documentation


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to remove auto message... struts2.