• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Problem with @RequestParam annotation.

 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

I am trying to write the fileUploader controller.

The JSP code are :



The controller method is



The request is mapped correctly to the method when I execute the code.

The Multipart resolver configured in context is





The spring version I am using is 3.1.1 The application server is glassfish 3.1.2

The error is




The browser return HTTP 400 with message descriptionThe request sent by the client was syntactically incorrect ().

Pl. Help

Thanks

 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is not a problem with your file upload code this usually indicates something is wrong with your URL mappings. Check your mappings in web.xml and double check your @RequestMapping value it does not look right to me.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bill,

The debug log shows me that the method is mapped correctly to URL.

Thanks



 
Bill Gorder
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok so humor me.

change



to





Also in your web.xml find where you have your dispatcher servlet mapping defined and make sure it is mapped to / as follows:



When I created a simple sample project using your code with the above changes it works correctly so try that first.

If that does not work...

The part of your exception that says

Required MultipartFile parameter 'filename' is not present



usually pops up when the below is missing:



Now I know you showed you have that in your config, but do you have it scoped so that the dispatcher servlet can see it? I would also double check that. If none of this works post your web.xml so we can have a look at it.

 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bill,

I had used similar solutions and worked fine. After some efforts I found the problem. The problem is the bug in the Glassfish 3.1.2. After installing the suggested patch it is working fine.
The JiRA link is Glassfish Jira

Thanks .

 
Bill Gorder
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Glad you got it figured out, thanks for posting back with the solution.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic