This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes File upload problem in model driven Action. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "File upload problem in model driven Action." Watch "File upload problem in model driven Action." New topic
Author

File upload problem in model driven Action.

Raza Mohd
Ranch Hand

Joined: Jan 20, 2010
Posts: 247

hi experts,

I am using Model driven Action class in my struts 2 application. In which all the property in the form are populated to the model by the ModelDrivenInterceptor. I need to populate the File tag property to the action instance, rather it is being populated to model as i am implementing model driven interface. Is there any possibility that we can populate one of the Form property to Action instance?

please give me a solution if anybody knows.



Getting OGNL exception If i use File property in action class.


My action contains.


Good luck!!
A small leak can sink a Gigantic ship.>
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Why are you using ModelDriven if you don't want form data to go to the model?

In any case, I would have assumed (and I don't have the source in front of me to check, unfortunately) that the ModelDrivenInterceptor would use the standard OGNL process, which would proceed down the stack looking for the setUpload method... although I think relying on hidden behavior like this in this case is unclear.

Are there any other messages in the log? Is devMode on?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: File upload problem in model driven Action.