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 [struts2] rendering textfielderror 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 "[struts2] rendering textfielderror" Watch "[struts2] rendering textfielderror" New topic
Author

[struts2] rendering textfielderror

khekhone yvan
Ranch Hand

Joined: May 08, 2011
Posts: 79
hi people
i don't know how change the color and position of textfield error message on my jsp . i use strut2.
on my actioncode, i use the methode validate


and on my jsp page :


the errorfield message display is automatic so cannot manage the position and the rendering on error message.in this case the error message is on the field and i want the message on the right field and the color red.

the second question i use the tag <s:fielderror fieldName="password"></s:fielderror> but the interline(the space between two ligne) how i can do to change that.

i m sorry my english is weak.can you help me.


any people can help me please to know how to
khekhone yvan
Ranch Hand

Joined: May 08, 2011
Posts: 79
if you dont understand something about my problem .ask me and i can to explain again .
pooja par
Ranch Hand

Joined: Feb 14, 2011
Posts: 31
I couldn't exactly understand what you want.
The below code would display all the field error messages of the jsp in red color above the form

In your jsp

You need to change the cssErrorStyle
cssErrorStyle is the attribute where you can define you own style and this will override cssErrorClass.

khekhone yvan
Ranch Hand

Joined: May 08, 2011
Posts: 79
hi pooja thank to answer me
i try your code its ok

but i use also


on my action

when you dont fill the field an error message display on the field.

the application manages itself the localisation and the color message without tag.

but i want change color and localisation message see the picture.

red color to my message instead black color.

the error message is on the field and i want on the right field.


[Download Sans titre.bmp] Download

pooja par
Ranch Hand

Joined: Feb 14, 2011
Posts: 31
I asked you to add ---cssErrorStyle="color:red;"--- as well in your JSP


did you add that.. and is still not working.
If that doesn't work add below code in your css


this link may help you
http://www.roseindia.net/struts/struts2/struts-2-example.shtml
khekhone yvan
Ranch Hand

Joined: May 08, 2011
Posts: 79
thanks pooja
yeah it's working now i put on my css file.
but now how to put on the right to the field.
pooja par
Ranch Hand

Joined: Feb 14, 2011
Posts: 31
I don't have any idea how to do that.. sorry
khekhone yvan
Ranch Hand

Joined: May 08, 2011
Posts: 79
no problem
thanks you are very kind to asnwer me and find my problem.
 
 
subject: [struts2] rendering textfielderror