Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

[struts2] rendering textfielderror

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you dont understand something about my problem .ask me and i can to explain again .
 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Filename: Sans-titre.bmp
File size: 226 Kbytes
 
pooja par
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have any idea how to do that.. sorry
 
khekhone yvan
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no problem
thanks you are very kind to asnwer me and find my problem.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic