MistyD
MistyD

Reputation: 17253

Form errors are not displayed after validation - Struts2

I have a form in simple HTML and does not use strut tags. When it goes through validation and on error the action does something like

      addFieldError( ""st_enroll.roll"", "Already taken" );

The problem is on error the user is directed back to the form as expected but the errors are not displayed. Is it because i am not using struts tags ? My form content is like this

 <label>Student Roll:</label>    <input type="text" name="st_enroll.roll"/> <br>

Any suggestions ?

Upvotes: 0

Views: 741

Answers (1)

Ash
Ash

Reputation: 1649

Use <s:fielderror/> in your jsp to show the errors. Put it where you want to display (probably at the top of page) and use <s:textfield> tag

Upvotes: 1

Related Questions