Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Struts2 Tag retrieve a Single fieldError as text only

Tags:

forms

jsp

struts2

How do I retrieve a single fielderror without any formatting?

I want just the plain text message without any formatting in a jsp is that possible?

This can be done in an action but how would I do this inside a jsp?

System.out.println(this.getFieldErrors().get("fileMissing"));
like image 323
user962206 Avatar asked Feb 10 '13 06:02

user962206


2 Answers

If you are using JSTL you can do this

<c:out value="${fieldErrors['passwordError']}"/>

and for struts tag, you can do this

<s:property value="fieldErrors['fileMissing']"/>
like image 115
KyelJmD Avatar answered Nov 09 '22 22:11

KyelJmD


You can use <s:fielderror /> in your jsp like this:

<s:fielderror fieldName="fileMissing"/>
like image 24
Ankur Lathi Avatar answered Nov 09 '22 22:11

Ankur Lathi