File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "File upload problem in model driven Action." Watch "File upload problem in model driven Action." New topic

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

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:
subject: File upload problem in model driven Action.
It's not a secret anymore!