tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken McWilliams <ken.mcwilli...@gmail.com>
Subject Re: Use of OGNL expression to access request headers
Date Tue, 30 Oct 2012 18:10:30 GMT
I've recently posted this answer here on SO:
Note the link in the question, which is required to understand the
full question. (http://stackoverflow.com/questions/10050433/ognl-and-wildcards-working-in-tiles-definitions-with-struts2-tiles-plugin/10067367#10067367)
I'm not sure what goes wrong but the plugin will not integrate with
tiles if using struts or Struts-tiles-plugin greater than version
Let me know if you have any question, sorry I know answers should
stand on their own but I don't have the time to bring all the content
over and format nicely.

On Tue, Oct 30, 2012 at 3:13 AM, Jose Luis Martinez Avial
<jlmartinez@pb-santander.com> wrote:
> Any ideas?
> -------------------------------
> José  Luis Martínez-Avial
> Web Applications Global Head
> Information Technology
> Santander Private Banking
> 1401 Brickell Avenue, Suite 1500, Miami FL 33131
> Phone: 305.539.2417
> -----Original Message-----
> From: Jose Luis Martinez Avial
> Sent: Wednesday, October 24, 2012 11:44 PM
> To: users@tiles.apache.org
> Subject: Use of OGNL expression to access request headers
> Hi,
>         I'm using Tiles 2.2.2  in my application (Struts 2.2.3). I want to use expressions
in order to modify my screen composition depending on some attribute in the request. Basically,
I would like to change the extends of a screen depending if there is a header in the request
with name "x-requested-with" and the value is "XMLHttpRequest". Is it possible to do that?
I've tried to do a simple example with an attribute:
> <put-attribute name="test"   expression="OGNL:requestScope"  cascade="true"/>
> I've tried different expressions like OGNL:%{#request.headers.referer}, OGNL:#request.headers.referer,
OGNL:requestScope.headers.referer , etc. But it always returns null. I haven't found any documentation
on how the OGNL expressions works on Tiles, so I'm working based on how I would do it with
Struts. But it doesn't seem to work. Can somebody help me?
> Thanks
> JL
> Internet communications are not secure and therefore Banco
> Santander International does not accept legal responsibility for
> the contents of this message. Any views or opinions presented
> are solely those of the author and do not necessarily represent
> those of Banco Santander International unless otherwise
> specifically stated.
> Las comunicaciones vía Internet no son seguras y, por lo tanto,
> Banco Santander International no asume responsabilidad legal
> ni de ningún otro tipo por el contenido de este mensaje.
> Cualquier opinión transmitida pertenece únicamente al autor y
> no necesariamente representa la opinión de Banco Santander
> International, a no ser que esté expresamente detallado.

View raw message