aspose file tools*
The moose likes Struts and the fly likes Passing values in Action Class 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 "Passing values in Action Class" Watch "Passing values in Action Class" New topic
Author

Passing values in Action Class

manikandan malathy
Greenhorn

Joined: Sep 17, 2008
Posts: 13
I have one problem in struts application please help me....
In my class have 2 action classes. One for searching some data and setting to request(request.setAttribut("Test",Test)).

But I am not getting these values in anohter action class... I am giving

request.getAttribute("Test");

But i am getting null values....
Vinoth Thirunavukarasu
Ranch Hand

Joined: Dec 18, 2008
Posts: 164

Hello,
Sorry for command.Tell me clearly then only we can help you.


Java Best Practices
Linux Best Practices
Amortization Calculator

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61057
    
  66

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
When the user makes a request to search for some data, there is an Action class that handles this request. What statement did you write for setting data in the request?
Alejandro Galvan
Ranch Hand

Joined: Jan 02, 2008
Posts: 48
Attributes within a request just live in that request, so, if you are calling one of your action classes from (lets say) a jsp, and then it gets back to another page and from that second page you call another action class, it is a different request, so the the attribute in your first request is no present in the second one, the first one just died, if you want more life time to the objects you can set the attributes in the session scope, like:

but that is not a completelly smart way


SCJP 5.0<br />Preparing SCWCD
 
wood burning stoves
 
subject: Passing values in Action Class