Hello all,
I am using both of myfaces and struts in my project. In one of my JSP
page, the legacy code uses struts to upload files. Since JSF does not
have a html file upload tag, I am still using struts tags for the file
uploading. I wrote my page like that:
<%-- JSF & STRUTS tag importing --%>
<f:view>
<f:verbatim>
<html:form action="/upload">
<html:file property =..... />
.....
</html:form>
</f:verbatim>
</f:view>
I have a struts action mapped to /upload.do, where actual uploading is
being done. It is like:
public class MyAction extends ...{
public ActionForward Execute(...){
uploadFile(...); //works fine
return mapping.findForward("success"); //exception thrown here
}
}
Everything works fine except that after the file is uploaded, my
action bean cannot forward to the designated "success" page.
In my struts.config, I configure the action like:
<action path="/upload" ...>
<forward name="success" path="/success.jsf" />
</action>
The error I got was:
java.lang.IllegalArgumentException: could not find pathMapping for
servletPath = /p/data/submit.do requestPathInfo = null
I have configured FacesRequestProcessor in the struts-config.xml and
faces context listener in the web.xml. I just did not use the <s:form>
because I need to use<html:file> in my JSP.
Also, I found that if there was the following action in my struts config file:
<action path="/hello" forward="/welcome.jsf"/>
I can not use "http://localhost/myapp/hello.do" to access the
/welcome.jsf directly. I got the same exception as mentioned above.
Sorry for my bad english and thanks for any help in advance
Qiang