File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Passing paramter from jsp to action class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Passing paramter from jsp to action class" Watch "Passing paramter from jsp to action class" New topic

Passing paramter from jsp to action class

netto gaurav

Joined: Jan 29, 2008
Posts: 7
hi i have a same problem
i have an list of records on one column i have the edit image which when clicked opens the record for editing now I'm not getting how to pass the value to the action class and how to get the values of the telephone at the action

the code is below:


<logic: present name ="ListArtist">
<logic:iterate id="ListArtist" name="ListArtist" indexId="i">
<td><bean:write name="i"/></td>
<td><bean:write name="ListArtist" property="name"/></td>
<td><bean:write name="ListArtist" property="telephone"/></td>
<td><bean:write name="ListArtist" property="countryName"/></td>
<td><a href=""><img src='<html:rewrite page="/images/actionEdit.gif"/>' width="18" height="15" border="0" /></a></td>
<td><img src='<html:rewrite page="/images/delete.png"/>' /></td>
</logic: present>

please reply its urgent
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 471

Hello Netto,

What you have in the code snippet you wrote is going to simply be transformed into dumb HTML code that you can't pass to the action. What you should do is to have a form, and have the parameters that you want to pass to the action as html inputs, so that when you submit the form, those parameters are passed to the action.

Visit my blog:
Ron Yoshimochi

Joined: Oct 06, 2003
Posts: 3

I have used this to pass parameters from a jsp into an action class

where the action class looks something like the one below

Michael Stains

Joined: Mar 07, 2008
Posts: 5
Hi, how can I retrieve the value of

<bean:write name="cat" property="catid" />

in the action class ?
soma lingam

Joined: Apr 26, 2007
Posts: 22
request.getParameter("..") using in action class is considered as security issue can anybody suggest by giving an example how to avoid using the above attribute in my struts application.
I agree. Here's the link:
subject: Passing paramter from jsp to action class
It's not a secret anymore!