This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

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.
Have you checked out Aspose?
subject: Struts Passing parameters
It's not a secret anymore!