struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Loupita <>
Subject Can I send parameters between jsp pages?
Date Thu, 05 Mar 2009 10:28:01 GMT

This is my issue:

I have a jsp with a list of users:
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
<%@ taglib uri="" prefix="display" %>

<sx:head parseContent="true"/>

<s:form action="PersonListAction" method="POST" validate="true">
<s:actionerror />
<s:fielderror />

<display:table name="persons" class="PersonListAction" >
  <display:column title="Förnamn" property="firstName" sortable="false" />
  <display:column title = "Efternamn" property="lastName" sortable="false"
  <display:column title = "E-mail" property="email" sortable="false"
href="UpdateDeleteUserAction.action" paramProperty="id" paramId="p"/>
  <display:column title = "Företag" property="company" sortable="false" />
  <display:column title = "Mobilnummer" property="mobile" sortable="false"


The jsp page looks like this when displayed: 

The email addresses are links that call UdateDeleteUserAction.action, which
redirects to  UpdateUser.jsp which has a form. When clicking an email adress
the id of that user is sent along with the URL as a parameter.

<%@ taglib prefix="s" uri="/struts-tags" %>
<title>Add new user.</title>
<link href="<s:url value="/css/main.css"/>" rel="stylesheet"
<s:form action="UpdateDeleteUserAction_*" method="POST" validate="true">
<s:actionerror />
<s:fielderror />
<s:hidden name="id" value="?"/>
<s:textfield name="firstName" label="Firstname"/>
<s:textfield name="lastName" label="Lastname"/>
<s:textfield name="email" label="E-mail"/>
<s:textfield name="phone" label="Mobile no."/>
<s:textfield name="company" label="Company"/>
<s:submit action="UpdateDeleteUserAction_update" value="update"/>  
<s:submit action="UpdateDeleteUserAction_delete" value="delete"/>
<s:submit action="UpdateDeleteUserAction_cancel" value="cancel"/>


I want the id which is sent with the URL to be set instead of the "?" in :
<s:hidden name="id" value="?"/>
In this case I want the outcome to be: <s:hidden name="id" value="10"/>

I know it's an ugly solution since the id of the user will be seen by
everyone. If you have any idea on how to do the same thing in a more secure
way, please tell.

Anyway, how can I do to get the id (p) from the URL to be set as the value
in the <s:hidden> tag?

Thanks in advance,
View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message