File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes sending form id to another action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "sending form id to another action" Watch "sending form id to another action" New topic
Author

sending form id to another action

Ar Reddy
Greenhorn

Joined: Nov 03, 2008
Posts: 20
Hi,
I have a showcontact.jsp it will shows all conct details with ids. for each contact need to display edit contact. edit contact is a different action and different jsp. how can I send id to that action. Please give me reply asap.
Thanks,
reddy

Rajagopal Mani
Ranch Hand

Joined: Mar 24, 2011
Posts: 84

If image is using for edit each contact, below code snippets can be reffered.





In corresponding action class
Ar Reddy
Greenhorn

Joined: Nov 03, 2008
Posts: 20
Thanks for you reply, but I have a question the below is the code I am using . I need to use this contID in editcontacts.action. please give me little bit explanation too.

<s:iterator value="ShowContacts" id="contact">
<tr>
<td> <s:property id="contID" value ="#contact.contactId" /></td>
<td> <s:property id="fName" value="# contact.firstName" /> </td>
<td> <s:property id="lName" value="# contact.lastName" /> </td>
<td> <s:property id="PNumber" value="# contact.PhoneNumber" /> </td>
<td> <s:property id="emailAddr" value="# contact.emailAddress" /> </td>
<td> editContact </td>
</tr>

Thanks
Reddy
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

You already have the necessary information in the FORM elements and in the corresponding Form bean. You need to create a new Form bean (the one that is associated with the Edit page) and populate the details in it. This would let you show up the detail in the Edit contact page.

I am assuming you are or Struts 1.x. If you are on 2.x then use the same similar logic.

Cheers,
Raj.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sending form id to another action
 
Similar Threads
html:link
How to bind/validate an object that is not the commandclass
Advice on managing objects in requests
Is session Id must for CRUD
[Struts & Hibernate] Edit & Delete rows