File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes How to pass java object b/w two actions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of RabbitMQ in Depth this week in the Open Source forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to pass java object b/w two actions" Watch "How to pass java object b/w two actions" New topic

How to pass java object b/w two actions

shwetank sharma

Joined: Jan 09, 2011
Posts: 10

Hi All,

Issue i m facing is that, i cannot pass object from one action class to another action class through jsp.

Let me explain you the scenario,

One of my action say action CreateView generates a view over jsp which contains multiple checkboxes,
also this action creates one hashmap which contains some data at the time of view generation.

I have kept that value as hidden

*Getter Setter for priorMap are present in action class

Now on submitting the form, i want to access that hashmap,

but it returns me null.

Thanks in advance..


Joe Ess

Joined: Oct 29, 2001
Posts: 9101

That's not going to work. HTML form fields are simple text. They can't hold a complex object like a map.
The easiest thing to do would be to store the map in the session.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: How to pass java object b/w two actions