struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meeboo <deeps...@gmail.com>
Subject Re: Problem with form action mapping
Date Wed, 18 Apr 2007 18:41:13 GMT

Oddly enough I checked out the code to continue my work from home and it
suddenly started working. I'm gonna take a look at this inconsistency
tomorrow, might be something else than S2 which is causing it. And yes, I'm
using the cleanup filter. Thanks anyway!


Dave Newton-4 wrote:
> 
> It may not solve your problem, but are you using the
> action context cleanup filter?
> 
> d.
> 
> --- meeboo <deepstar@gmail.com> wrote:
> 
>> 
>> Quick note, it seems as if I am reaching the
>> uploadFile method when not
>> specifying a file to upload. The movieTitle is then
>> read in the action
>> class. But if I also choose to upload a file
>> alongside with it the method
>> will not be reached. I'm stumped! :(
>> 
>> 
>> meeboo wrote:
>> > 
>> > 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#a10060312
>> Sent from the Struts - User mailing list archive at
>> Nabble.com.
>> 
>> 
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> user-unsubscribe@struts.apache.org
>> For additional commands, e-mail:
>> user-help@struts.apache.org
>> 
>> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

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


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message