In my Struts2 JSP form, there are text fields and a select tag. For example,
<s:form>
<s:textfield name="name" label="Name"/>
<s:textfield name="dob" label="Date of Birth"/>
<s:select name="degree" list="degreeList" listKey="degreeID" listValue="degreeName"/>
<s:submit/>
</s:form>
Before this JSP is loaded, I filled degreeList
in action class.
I need to validate this form. So I tried the validation framework. But the problem is action class return "input"
itself if the validation failed. I cannot refill the degreeList
if the validation failed. So the above JSP cannot be loaded. The error says degreeList
is not list/collection as the list is no longer in the value stack. Somebody please kindly guide me how can I validate in another way? Thanks.