struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Jouravlev" <>
Subject Re: Extra parameter value for DispatchAction.
Date Tue, 27 Feb 2007 01:37:24 GMT
Dilep, use struts-user forum for questions like this.

On 2/26/07, Dilep <> wrote:
> Hi,
> Is there a way to pass a extra paramameter for DispatchAction
> apart from parameter=method.

"parameter=method" is not meant to pass parameters to an action,
parameters are passed in request object.

> Onclick on a link(<html:link action="/">)
> from Search Results, I wanna to pass the primary key value.
> I can't use hidden values as it is not a form.

If you have one link per row then just add your PK to the link
directly. If you have one link per whole table then you will need to
modify the link dynamically with Javascript.

> I have one solution. But i don't know its proper approach. I tryig to set the session
in javascript and its not working.

If it does not work then it's not a solution.

> onclick="javascript:clickRequestId(primaryKeyValue));
> function clickRequestId(value) {
>          var primaryKey = value;
>          session.setAttribute("id",primaryKey);
>  }.
> Any one has any idea please..

You cannot access server-side session object from browser-contained
Javascript code. I mean, not in the fashion above. You need to read
sevlets/JSP book first to understand browser/server interaction.


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

View raw message