Hey all

I've been trying to solve this problem for a couple of hours but to no
prevail...

struts.xml
<action name="upload/">
     <result>/uploadMovie.jsp</result>
</action>
<action name="uploadMovie"
                                class="com.myapp.web.struts.action.UploadMovie"
                                method="uploadFile">
     <result name="success">/index.jsp</result>
      <result name="input">/uploadMovie.jsp</result>
</action>

uploadMovie.jsp
<s:form action="/uploadMovie" enctype="multipart/form-data" method="post">
<s:textfield name="movieTitle"/>
<s:file name="uploadedMovie"/>
<s:submit value="Upload"/>
</s:form>

UploadMovie.java
public String uploadFile()
{
        if(movieTitle != null && uploadedMovie !=null)
                return SUCCESS;
        else
                return INPUT;
}

What I'm doing is that I'm accessing localhost:8080/someApp/upload/ - so far
so good, the form shows up and you can pick the file to upload. But when I
submit the form it never reaches the uploadFile() method! The odd thing is
that when I view the HTML source for the form it says 
"<form id="uploadMovie" onsubmit="return true;" action="/myApp/uploadMovie"
method="post" enctype="multipart/form-data">" - which is correct. If I on
the other hand access the url http://localhost:8080/myApp/uploadMovie
directly from the browser (without using the form) the uploadFile() method
will be reached. I find this pretty confusing and suspect that there's a
mapping error somewhere in the code, but I haven't been able to identify it
even after a couple of hours. Any takers?

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Problem-with-form-action-mapping-tf3601247.html#a10059516
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to