tomcat - Getting a 404 There is no Action mapped for namespace error -


i'm working struts2 web application. running fine. actions getting mapped , application correctly redirects pages. however, when same particular module (related file upload), fails! don't understand what's wrong, i've tried various combos of "/" , , still can't page re-direct. doing wrong?

my struts.xml :

<?xml version="1.0" encoding="utf-8" ?> <!--  <!doctype struts public     "-//apache software foundation//dtd struts configuration 2.0//en"     "http://struts.apache.org/dtds/struts-2.0.dtd">      -->     <!doctype struts public "-//apache software foundation//dtd struts configuration 2.1//en"      "http://struts.apache.org/dtds/struts-2.1.dtd">   <struts>     <constant name="struts.enable.dynamicmethodinvocation"         value="false" />     <constant name="struts.devmode" value="false" />     <constant name="struts.custom.i18n.resources"         value="applicationresources" />      <package name="default" extends="struts-default" namespace="">         <action name="login" class="com.proconsulto.action.loginaction" method="execute">             <result name="success">/dashboard.jsp</result>             <result name="failure">/signin.jsp</result>            </action>             <action name="signup" class="com.proconsulto.action.useraction" method="adduser">             <result name="success">/dashboard.jsp</result>             <result name="failure">/signin.jsp</result>            </action>              <action name="logout" class="com.proconsulto.action.loginaction" method="logout">             <result name="success">/signin.jsp</result>             </action>             <action name="placerequest" class="com.proconsulto.action.placerequestaction" method="placerequest">            <result name="success">/success.jsp</result>            </action>      </package> </struts> 

and form should redirect:

<s:form theme="simple" action="placerequest.action" enctype="multipart/form-data" method="post">             <ul style="list-style-type:none;">             <li class="field"><p id="qaz">headline : <br/><s:textfield style="width:550px;align:center;display:inline;" name="headline" cssclass="text input"></s:textfield></li>             <li class="field"><p id="qaz">description :<br/> <s:textarea style="width:550px;display:inline;align:center;" name="description" cssclass="textarea input"></s:textarea></li>             <li class="field"><p id="qaz">file upload (if any) :<br/> <s:file style="height:auto;width:550px;display:inline;align:center;" name="userimage" cssclass="text input" /></li>             <div class="medium default btn"><s:submit value="proceed"/></div>&nbsp;&nbsp;             <div class="medium default btn"><s:reset value="reset"/></div> 

placerequest action won't mapped!

please help.

complete error message:

type status report

message there no action mapped namespace [/] , action name [placerequest] associated context path [/proconsulto].

description requested resource (there no action mapped namespace [/] , action name [placerequest] associated context path [/proconsulto].) not available.

you should add namespace package, namespace="/". if want stick namespace="" (that create problems and/or unattended results), can try specify in form:

<s:form action="placerequest.action" namespace="" ... > 

also, test purposes only, include in project struts2 config browser plugin, see how actions mapped (browse them left menu).

enter image description here

remember remove before releasing production ;)


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -