Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

passing parameter between pages in struts2 using hyperlink

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<a href=edit.jsp?id="<%=UserID %>">edit</a>

This is thae code i want to convert to struts2 format.

I tried

<s:url id="editUrl" action="edituser2" >
<s:param name="id" value="%{UserID}" />
</s:url>
<s:a href="%{editUrl}">Edit</s:a>

and

<s:url id="editUrl" action="edituser2" >
<s:param name="id" value="%{UserID}" />
</s:url>
<s:a href="<%=UserID %>">Edit</s:a>
but still its not working... Any 1 could help me?

In struts.xml

<action name="edituser2" class="com.action.edituseraction">
<result name="useredit" type="tiles">edituser1</result>
</action>

and in action class

package com.action;
import java.util.ArrayList;
import com.opensymphony.xwork2.ActionSupport;
public class edituseraction extends ActionSupport{
private static final long serialVersionUID = -2613425890762568273L;


private String id;

public String execute() {
System.out.println(id);
return "useredit";

}
public String getid() {
System.out.println(id);
return id;
}
public void setid(String value) {
System.out.println(id);
this.id = value;
} }


This is what i tried
 
sarin jacob
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It worked

<a href=edituser2?&id="<%=UserID %>">edit</a>

 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic