Win a copy of Spark in Action this week in the Open Source Projects forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

incompatible: File Upload + Validator Client side JS

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi have a form that contain a mix of text fields and a file upload input field. ex:

<html:form method="post" action="/uploadRequest" enctype="multipart/form-data" name="MyRequestForm" scope="session" type="com.myapp.form.MyRequestForm">

<html:file styleClass="myTextBox" name="MyRequestForm" property="myRequestFile"></html:file>

<input type="text" ...>
<input type="text" ...>

<html:submit value="Upload Your Request" styleClass="buttons">
</html:submit>


</html:form>


I use the validator framework to validate my input fields.

I also have a validation in my ActionForm to look if the size of the file is < 1MB.

If I don't use any client side validation, there's no problem. The validation for the max file size works.

If I enable the client side validation using the html:javascript tag, the request never come back!

I see in the log that the validate() method detect the error for the file size, and the input is forward to my JSP but I don't see anything in the browser, it's seems that the response is endless...

P.S. I could use a redirect when the error occurs but it's not acceptable from the user point of view (I really need a forward)

Any ideas?

Thanks
 
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic