This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 60785
    
  65

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing values in Action Class
 
Similar Threads
Problem with iframe in struts 1.1 applicaton
JSP Form values Not able to submit
Need help in getting check box values
Action class being called twice from jsp
Export of database in Oracle