You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Diego Ezquerro <d....@yahoo.com> on 2007/10/03 17:00:02 UTC

Struts Popup window with session param

Hi to everybody.

I have a problem with a JSP page, I think this is a stupid question but I was hours searching the Internet and found nothing.

What i wanna do is to pre-process a session attribute and then show a popup window with the result.
My code is as follows:

<a href="#" OnClick="window.open('./fillTrazability.do?param1=srd_tree', '', false); return false;">Set Trazability</a>

"srd_tree" is a session attribute and this doesn't work.

Then i tried this:

<a
href="#" OnClick="window.open('./fillTrazability.do?param1=<%= session.getAttribute("srd_tree") %>',
'', false); return false;">Set Trazability</a>

and the result is a Scripting elements (<%!, <jsp:declaration, <%=, <jsp:expression, <%, <jsp:scriplet ) are disallowed here.

Is there any way to do this using struts tags??
All that i want is to pass that session attribute (it isn't a String) to fillTrazability action class.

I've tried too:

<bean:parameter id='srd_tree' name='tree'/>
<a
href="#" OnClick="window.open('./fillTrazability.do?param1=tree',
'', false); return false;">Set Trazability</a>

obtaining no results.

Anyone can help me??

Thanks a lot.

 
Diego Ezquerro Bailac
Asturias, Spain








      
¡Sé un mejor fotógrafo!
Perfecciona tu técnica y encuentra las mejores fotos en:

http://telemundo.yahoo.com/promos/mejorfotografo.html





      ____________________________________________________________________________________
¡Sé un mejor besador!
Comparte todo lo que sabes sobre besos.                      
http://telemundo.yahoo.com/promos/mejorbesador.html

Re: Struts Popup window with session param

Posted by Antonio Petrelli <an...@gmail.com>.
2007/10/3, Diego Ezquerro <d....@yahoo.com>:
>
> All that i want is to pass that session attribute (it isn't a String) to
> fillTrazability action class.



Since it is a session-scoped attribute, why don't you read it directly in
your destination page, without passing any parameter?

Antonio

Re: Struts Popup window with session param

Posted by Dave Newton <ne...@yahoo.com>.
IIRC somebody asked why you couldn't just access the
session parameter in the action rather than sending it
as a request parameter. What was the answer to that
question?

d.

--- Diego Ezquerro <d....@yahoo.com> wrote:

> Hi to everybody.
> 
> I have a problem with a JSP page, I think this is a
> stupid question but I was hours searching the
> Internet and found nothing.
> 
> What i wanna do is to pre-process a session
> attribute and then show a popup window with the
> result.
> My code is as follows:
> 
> <a href="#"
>
OnClick="window.open('./fillTrazability.do?param1=srd_tree',
> '', false); return false;">Set Trazability</a>
> 
> "srd_tree" is a session attribute and this doesn't
> work.
> 
> Then i tried this:
> 
> <a
> href="#"
>
OnClick="window.open('./fillTrazability.do?param1=<%=
> session.getAttribute("srd_tree") %>',
> '', false); return false;">Set Trazability</a>
> 
> and the result is a Scripting elements (<%!,
> <jsp:declaration, <%=, <jsp:expression, <%,
> <jsp:scriplet ) are disallowed here.
> 
> Is there any way to do this using struts tags??
> All that i want is to pass that session attribute
> (it isn't a String) to fillTrazability action class.
> 
> I've tried too:
> 
> <bean:parameter id='srd_tree' name='tree'/>
> <a
> href="#"
>
OnClick="window.open('./fillTrazability.do?param1=tree',
> '', false); return false;">Set Trazability</a>
> 
> obtaining no results.
> 
> Anyone can help me??
> 
> Thanks a lot.
> 
>  
> Diego Ezquerro Bailac
> Asturias, Spain
> 
> 
> 
> 
> 
> 
> 
> 
>       
> ¡Sé un mejor fotógrafo!
> Perfecciona tu técnica y encuentra las mejores fotos
> en:
> 
>
http://telemundo.yahoo.com/promos/mejorfotografo.html
> 
> 
> 
> 
> 
>      
>
____________________________________________________________________________________
> ¡Sé un mejor besador!
> Comparte todo lo que sabes sobre besos.             
>         
> http://telemundo.yahoo.com/promos/mejorbesador.html


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