Ravi Kant
Ravi Kant

Reputation: 5005

Url Encryption in java(Struts2)

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

Answers (3)

Dave Newton
Dave Newton

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

PD Shah 5382
PD Shah 5382

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

hawks
hawks

Reputation: 114

you can use the HTTP POST method to send the parameters.

Upvotes: 1

Related Questions