vikiiii vikiiii -5 years ago 436
Java Question

HTTP Status 500 - No action instance for path /adduser could be created in struts

I have a JSP page in which there is a hyperlink to add user.

<html:link action=""> Add New User < /html:link>

My struts-config file contains

<action path="/login" name="LoginForm" validate="true" input="/index.jsp"
<forward name="successadmin" path="/home.jsp" />
<forward name="failure" path="/index.jsp" />
<forward name="successuser" path="/welcome.jsp" />

<action path="/adduser" name="AdduserForm" validate="true" input="/adduser.jsp"
<forward name="success" path="/userconfirm.jsp" />

<action path="/openadduser" name="AdduserForm" validate="true" type="useraction.AdduserAction"
<forward name="success" path="/userconfirm.jsp" />

And my adduser.jsp contains code

<html:form action="/adduser">
< h1 align="center"> ADD NEW USER < /h1>
< bean:message key="label.fname"/> <br/>
<html:text property="fname"></html:text><br/>
<html:errors property="fname" /><br/>
</html:form></body></html> contain

public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception
AdduserForm adduserForm = (AdduserForm) form;

fname = adduserForm.getFname().toString();
return mapping.findForward("success");


I am using Tomcat server.And after i click on submit button of add user.
It give the following error.
HTTP Status 500 - No action instance for path /adduser could be created in struts.

I think there is a problem in struts-config file.
What can i do to remove this error ?
Thank you for the help.

Answer Source

I think appending .do in your jsp should solve the problem

<html:form action="">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download