javax.servlet.ServletException: No form found under ‘UserLoginForm’ in locale ‘en_US’

This is the exception thrown when i try to perform client-side validations using dynavalidatorform in struts:
solution: check for the form name in the following files, this is where the problem occurs most of the times. Even is we add ‘/’ to the formname somewhere it throws the above exception.
1) In Jsp file
<html:form action=”/UserLoginAction” onsubmit=”return validateUserLoginForm(this)”>
<html:javascript formName=”UserLoginForm“/> It looks for the form name in the below file.
3) In validation.xml file
<form name=”UserLoginForm“> 
       ……..
  </form>
4) In struts-config.xml file
<form-bean name=”UserLoginForm” type=”org.apache.struts.validator.DynaValidatorForm”>
   …………………….. 
        </form-bean>
<action input=”/userlogin.jsp” name=”UserLoginForm” path=”/UserLoginAction”
                scope=”request” type=”com.myapp.struts.UserLoginAction” validate=”true”>
                    <forward name=”success”  path=”/userloginsuccess.jsp”/>
        </action>

About vchaithanya

Software Engineer
This entry was posted in java. Bookmark the permalink.

Leave a comment