This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Struts and the fly likes Including Request parameters to the response Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Including Request parameters to the response" Watch "Including Request parameters to the response" New topic

Including Request parameters to the response

pamir sonmez
Ranch Hand

Joined: May 31, 2010
Posts: 47
Let me explain what I wanted simply,

Firstly in 1.jsp page I have a textbox and from this page and action method is called
In this method, I can reach the value of the textbox from request, from this method 2.jsp page is called
in this jsp page an action method is called
and in this method I want to reach same textbox value

in the first action method I can put it into the session object.
Or is there some including mechanism that I can direct parameter of 1.jsp to the 2.jsp page.

in action method, I use actionMapping.findforward(....) method
Jesus Mireles
Ranch Hand

Joined: Mar 10, 2010
Posts: 122

I'm not sure what your really asking but from my understanding do you not want to use session?
pamir sonmez
Ranch Hand

Joined: May 31, 2010
Posts: 47
you are right,I dont want to use session.

In the first action method(called from 1.jsp) I can reach the textbox value
and in the second action method(called from 2.jsp), I want to reach the value of textbox in the 1.jsp page
How can I include value of textbox to the request scope of 2.jsp page?
James Peter
Ranch Hand

Joined: Sep 15, 2010
Posts: 115
1. Create textfield property in action. for example text1.

2. Action properties are exposed via public getter methods:
public String getText1() {
return getText("from.class.props");
Now, we can access the text in our JSP via the text1 action property:
<s:property value="text1"/>

So value will be passed from 1.jsp to action and to 2.jsp
subject: Including Request parameters to the response