• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sending form id to another action

 
Ar Reddy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 84
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If image is using for edit each contact, below code snippets can be reffered.





In corresponding action class
 
Ar Reddy
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 445
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic