tags:

views:

13

answers:

1

I am using struts2 application with the jsp page ,

i am using struts-tags:textfeilds , and i have a submit button in it ,

i have applied validation for them , when i hit the button the error messages are

appearing at the feild level(ie.beside the feild ) , i have used the to make the error messages appear where ever i want , but the messages beside the feilds are not removing ,How do i remove the messages from there .

Thanks

A: 

Do you know which theme you are using? You could try adding theme="basic" to your <s:textfield> tag - I think what you're seeing is Struts using some freedoms granted by the theme in use and rendering the <s:fieldError> tags for you.

Lauri Lehtinen
I am using struts2 , i dont have the basic theme , the problem is i dont want the error message to be appear at the feild level ,i have css_xhtml,xhtml,simple and ajax themes but these doesn't help for me
jyo
Did you try the simple one? That's the one I meant actually - sorry. To clarify - I understand you don't want the error message to be rendered next to the field (I think this can be solved with using a simple theme or redefining the text.ftl that your theme uses), but do you also want the error messages to appear elsewhere, and possibly as action errors (instead of fielderrors)?
Lauri Lehtinen
Yes,I am displaying all the error messages above the form,but the error message is also appearing next to the feild ,i dont want that.I have tried using the simple theme but not satisfing all my requirements ,where/how do i change in the text.ftl to solve my problem
jyo
Add a folder with the theme's name (such as `simple`) in your classpath (i.e. under `classes`), copy `text.ftl` from inside `struts-core.jar:/simple/` to your folder, and edit it. Then just make sure your `s:` tags use the theme you are overriding.
Lauri Lehtinen