i am trying to put validation into my image upload form using struts2 interceptor if users submits invalid image extension there there should be validation error message?
uploadThemeImage.jsp
<s:form action="updatethemeimageform" method="post" enctype="multipart/form-data" id="remoteform" theme="simple" >
<s:hidden value="%{#parameters.themeid}" name="themId"/>
<s:file name="thempic" label="Theme Screenshot" />
<sj:a button="true" id="btnsid" buttonIcon="ui-icon-gear" dataType="json" indicator="indicator" onSuccessTopics="reloadMyGrid,handleJsonResult"
formIds="remoteform" targets="result">Submit This Form</sj:a> </s:form>
You can’t see the error if you don’t put an
<s:fielderror />tag in your JSP.Add it before
<s:form>and you will see your validation error…P.S: the same applies to
<s:actionmessage />and<s:actionerror >(that are not involved with the validation but added by you)