Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning 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
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Struts 1.2.4 File Upload - Form File is null in action

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using struts 1.2.4, running my app on WLS 10.3. I've used file upload millions of times in the past and it's been as simple as the struts example. But this latest piece of code I'm working on, when it's gets to the action the form file is null. I check to see if the request is Multipart and it is. The other field on the form has data, but the form file field is empty. Does anyone have a clue what I could be doing wrong? I'm adding the code below.

FORM CLASS



ACTION CLASS


JSP PAGE


STRUTS-CONFIG


If you have any suggestions, please let me know
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

 
C Dow
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks so much. I just discovered that I was calling setFormFile vs. setFile in my Action Form. Was completely overlooking that for 2 days.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No problem, and welcome to JavaRanch!
 
Every plan is a little cooler if you have a blimp. And a tiny ad.
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic