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 Removing the msgs of the required fields 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 "Removing the msgs of the required fields" Watch "Removing the msgs of the required fields" New topic
Author

Removing the msgs of the required fields

Jyothi Sree
Ranch Hand

Joined: Jun 14, 2010
Posts: 41
Hai

I have a small problem in struts 2 application .
I have a Jsp Page with required feilds in it .which gives error messages, when i press submit with out entering the values in it .
those messages are displaying beside the text feilds ,

If i put the <s:actionerror />
<s:fielderror />
<s:actionmessage/> these tags ,messages is appearing at that position and aslo beside the text field , I dont want the messages to appear beside the textfeild ..


How should i do that ?

Thanks
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

Using simple theme is an option. I'm sure there are other solutions too but David might know more about them...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Using the "simple" theme is one answer, otherwise you'd need to modify/extend an existing style to not display them at the field level.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

Please use real words when posting to the forums. Abbreviations such as "msgs" in place of "messages" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please click this link ⇒ UseRealWords for more information.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jyothi Sree
Ranch Hand

Joined: Jun 14, 2010
Posts: 41
Hi
I have applied the simple theme to my struts-tag:form but the text feilds are appearing one after the other in a row .i want them one below the other .Can i get the detail information modifying the style ..

how do i do that .. I mean where can i get the css file to change the style ..

I m using struts2 .x

Thanks
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Then put a <br/> tag between them, or put them in a table like the default theme does, or... there are any number of solutions.
Jyothi Sree
Ranch Hand

Joined: Jun 14, 2010
Posts: 41
The Simple theme is not displaying the label for the feild . i have tried putting < s:label > but it is dispalying the ' key' attribute value as it is , i mean it is not reading frm the resoucebundle .
so i cannot use simple theme ,Then how to remove the Error messages appearing beside or above the feild ....


David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

David Newton wrote:Using the "simple" theme is one answer, otherwise you'd need to modify/extend an existing style to not display them at the field level.
Jyothi Sree
Ranch Hand

Joined: Jun 14, 2010
Posts: 41

Hi

I m still waiting for the answer ,,,,

How do i remove the error messages at the field level ....


Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Removing the msgs of the required fields
 
Similar Threads
validation of entire form
Error Message rendering twice in struts2 because of integration with spring
Beginning Object Oriented javascript' question- Handle Memory leaks in javascript
Logout servlet problem with back button
Error Message rendering twice in struts2 because of integration with spring