File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts Passing parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Passing parameters" Watch "Struts Passing parameters" New topic

Struts Passing parameters

raju sand

Joined: Jun 16, 2013
Posts: 8
hey please help me

how can i send parameter values to stuts action class

actually i have list i displayed following way



if i click link 1 i want parameter as 1
if i click link2 want parmeter 2

if i send html:link action=/actionclass?param=1"

but it shown in url

i dont want to shoow the param in url so how can i

please hrlp me
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

Greetings Raju ,

How about using the struts form with HTTP POST ? That way the param wont be shown in the URL .

Another way would be to use hidden values to pass the parameters from one action to another.

Muhammad Saif Asif Mirza
raju sand

Joined: Jun 16, 2013
Posts: 8
its resolve with javascript action using with hidden value

but is der any other way to achieve it
Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

There are several other ways to pass values between struts actions but for your case , those wont prove good. I'll tell you anyway

1. Use OGNL expressions in your struts.xml file to pass parameter from one action to another
2. Use the hidden value strategy
3. Make user of the ValueStack to pass paramters using JSTL and OGNL between the action classes.

Do post back for any further queries.
I agree. Here's the link:
subject: Struts Passing parameters