Reputation: 5005
I am using Struts 2 for my app.In that i am accessing one link through mail.There i am passing url with query string. Now i have to access those request parameter in jsp as well as in java.
Here is one sample example.
http://test.com/testProject/testAction?testItem=10&testSecondItem=20
In jsp-
${testItem}
In java-
request.getParameter("testSecondItem").
Now my requirement is very simple i don't want to display those parameter and their value in query string and want to access at both place on jsp as well as in java.
Upvotes: 0
Views: 860
Reputation: 160271
If you're sending an email that contains the link, don't send a direct link.
Construct a short-URL-style link with a GUID tied to the user and the params. When the link is hit, either forward to the link with the params, or do all that work on the back end and show the results.
This has the additional benefit of providing trivial link tracking to help you monitor the effectiveness of your email blasts, who's following through, and under what circumstances.
Upvotes: 0
Reputation: 31
If you don't want to display parameter than
The best thing in Struts2, use of hidden value
let me show you an example
<s:hidden name="url" value="valuetosendtoserver" />
insteading of using parameter try using hidden value.
Upvotes: 0