struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Jouravlev" <jmi...@gmail.com>
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 <forum-struts-dev@opensymphony.com> 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="/someform.do?method=getRecord">)
> 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.

Michael.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message