You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by matthieu martin <ma...@gmail.com> on 2008/03/13 15:19:46 UTC

not interpreted

Hi all !

I have a little issue and I find no clues on the web, so i'm turning myself
to you.

I have a piece of code like this :


<div id="menu_image_gallerys<s:property value='id'/>">

          <s:property id="<s:property value='id'/>" value="id"/>

          <s:a theme="ajax" href="%{EditImageGallery}"
targets="dataImageDiv<s:property value='id'/>">Edit</s:a>

          <s:a theme="ajax" href="%{MoveImageGallery}"
targets="dataImageDiv<s:property value='id'/>">Move</s:a>

          <s:a theme="ajax" href="%{copyImageGallery}"
targets="dataImageDiv<s:property value='id'/>">Copy</s:a>

</div>

<div id="dataImageDiv<s:property value='id'/>" />



this piece of code is placed in a loop, and creates a small menu for each
images I have in galleries. The dataImageDiv is used to contain whatever
form I need.

The problem is that my <s:property> tags contained in my <s:a> tags aren't
interpreted. After few manipulations, I observed that the <s:property> tag
is interpreted only if it's not contained in a struts tag. For instance :

<div id="dataImageDiv<s:property value='id'/>" />

produces

<div id="dataImageDiv1" />

BUT

<s:div id="dataImageDiv<s:property value='id'/>" />

produces

<div id="dataImageDiv<s:property value='id'/>" />



Thus, my piece of code produces :

<div id="menu_image_gallerys1">

          1

          <s:a theme="ajax" href="%{EditImageGallery}"
targets="dataImageDiv<s:property value='id'/>">Edit</s:a>

          <s:a theme="ajax" href="%{MoveImageGallery}"
targets="dataImageDiv<s:property value='id'/>">Move</s:a>

          <s:a theme="ajax" href="%{copyImageGallery}"
targets="dataImageDiv<s:property value='id'/>">Copy</s:a>

</div>

<div id="dataImageDiv1/>



As I'm using this in a loop, it's obviously not working, the targets and the
divs not matching.

This is driving me nuts. Do I do something wrong ? Would you have an idea ?
The <s:head theme="ajax"/> is well included in my header.

Thanks in advance,



Matthieu

Re: not interpreted

Posted by matthieu martin <ma...@gmail.com>.
On Thu, Mar 13, 2008 at 3:26 PM, Richard Sayre <ri...@gmail.com>
wrote:

> try:
>
> <s:a theme="ajax" href="%{copyImageGallery}"
> targets="dataImageDiv%{id}"/>">Copy</s:a>
>
>
> if id is on the stack, you can get it with OGNL
>

This works, thanks a lot. I haven't working for a long time with struts 2
and I still have some issues figuring out what's on the stack and what's not
...

thanks again !

>
> On Thu, Mar 13, 2008 at 10:49 AM, matthieu martin <ma...@gmail.com>
> wrote:
> > Hi all !
> >
> >  I have a little issue and I find no clues on the web, so i'm turning
> myself
> >  to you.
> >
> >  I have a piece of code like this :
> >
> >
> >  <div id="menu_image_gallerys<s:property value='id'/>">
> >
> >           <s:property id="<s:property value='id'/>" value="id"/>
> >
> >           <s:a theme="ajax" href="%{EditImageGallery}"
> >  targets="dataImageDiv<s:property value='id'/>">Edit</s:a>
> >
> >           <s:a theme="ajax" href="%{MoveImageGallery}"
> >  targets="dataImageDiv<s:property value='id'/>">Move</s:a>
> >
> >           <s:a theme="ajax" href="%{copyImageGallery}"
> >  targets="dataImageDiv<s:property value='id'/>">Copy</s:a>
> >
> >  </div>
> >
> >  <div id="dataImageDiv<s:property value='id'/>" />
> >
> >
> >
> >  this piece of code is placed in a loop, and creates a small menu for
> each
> >  images I have in galleries. The dataImageDiv is used to contain
> whatever
> >  form I need.
> >
> >  The problem is that my <s:property> tags contained in my <s:a> tags
> aren't
> >  interpreted. After few manipulations, I observed that the <s:property>
> tag
> >  is interpreted only if it's not contained in a struts tag. For instance
> :
> >
> >  <div id="dataImageDiv<s:property value='id'/>" />
> >
> >  produces
> >
> >  <div id="dataImageDiv1" />
> >
> >  BUT
> >
> >  <s:div id="dataImageDiv<s:property value='id'/>" />
> >
> >  produces
> >
> >  <div id="dataImageDiv<s:property value='id'/>" />
> >
> >
> >
> >  Thus, my piece of code produces :
> >
> >  <div id="menu_image_gallerys1">
> >
> >           1
> >
> >           <s:a theme="ajax" href="%{EditImageGallery}"
> >  targets="dataImageDiv<s:property value='id'/>">Edit</s:a>
> >
> >           <s:a theme="ajax" href="%{MoveImageGallery}"
> >  targets="dataImageDiv<s:property value='id'/>">Move</s:a>
> >
> >           <s:a theme="ajax" href="%{copyImageGallery}"
> >  targets="dataImageDiv<s:property value='id'/>">Copy</s:a>
> >
> >  </div>
> >
> >  <div id="dataImageDiv1/>
> >
> >
> >
> >  As I'm using this in a loop, it's obviously not working, the targets
> and the
> >  divs not matching.
> >
> >  This is driving me nuts. Do I do something wrong ? Would you have an
> idea ?
> >  The <s:head theme="ajax"/> is well included in my header.
> >
> >  Thanks in advance,
> >
> >
> >
> >  Matthieu
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: not interpreted

Posted by Richard Sayre <ri...@gmail.com>.
try:

<s:a theme="ajax" href="%{copyImageGallery}"
targets="dataImageDiv%{id}"/>">Copy</s:a>


if id is on the stack, you can get it with OGNL

On Thu, Mar 13, 2008 at 10:49 AM, matthieu martin <ma...@gmail.com> wrote:
> Hi all !
>
>  I have a little issue and I find no clues on the web, so i'm turning myself
>  to you.
>
>  I have a piece of code like this :
>
>
>  <div id="menu_image_gallerys<s:property value='id'/>">
>
>           <s:property id="<s:property value='id'/>" value="id"/>
>
>           <s:a theme="ajax" href="%{EditImageGallery}"
>  targets="dataImageDiv<s:property value='id'/>">Edit</s:a>
>
>           <s:a theme="ajax" href="%{MoveImageGallery}"
>  targets="dataImageDiv<s:property value='id'/>">Move</s:a>
>
>           <s:a theme="ajax" href="%{copyImageGallery}"
>  targets="dataImageDiv<s:property value='id'/>">Copy</s:a>
>
>  </div>
>
>  <div id="dataImageDiv<s:property value='id'/>" />
>
>
>
>  this piece of code is placed in a loop, and creates a small menu for each
>  images I have in galleries. The dataImageDiv is used to contain whatever
>  form I need.
>
>  The problem is that my <s:property> tags contained in my <s:a> tags aren't
>  interpreted. After few manipulations, I observed that the <s:property> tag
>  is interpreted only if it's not contained in a struts tag. For instance :
>
>  <div id="dataImageDiv<s:property value='id'/>" />
>
>  produces
>
>  <div id="dataImageDiv1" />
>
>  BUT
>
>  <s:div id="dataImageDiv<s:property value='id'/>" />
>
>  produces
>
>  <div id="dataImageDiv<s:property value='id'/>" />
>
>
>
>  Thus, my piece of code produces :
>
>  <div id="menu_image_gallerys1">
>
>           1
>
>           <s:a theme="ajax" href="%{EditImageGallery}"
>  targets="dataImageDiv<s:property value='id'/>">Edit</s:a>
>
>           <s:a theme="ajax" href="%{MoveImageGallery}"
>  targets="dataImageDiv<s:property value='id'/>">Move</s:a>
>
>           <s:a theme="ajax" href="%{copyImageGallery}"
>  targets="dataImageDiv<s:property value='id'/>">Copy</s:a>
>
>  </div>
>
>  <div id="dataImageDiv1/>
>
>
>
>  As I'm using this in a loop, it's obviously not working, the targets and the
>  divs not matching.
>
>  This is driving me nuts. Do I do something wrong ? Would you have an idea ?
>  The <s:head theme="ajax"/> is well included in my header.
>
>  Thanks in advance,
>
>
>
>  Matthieu
>

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


Re: not interpreted

Posted by Randy Burgess <RB...@nuvox.com>.
Since 2.0.11. But you can still use it outside of Struts tags.

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: GF <ga...@gmail.com>
> Reply-To: Struts Users Mailing List <us...@struts.apache.org>
> Date: Wed, 19 Mar 2008 15:09:16 +0100
> To: Struts Users Mailing List <us...@struts.apache.org>
> Subject: Re: <s:property in <s:*> not interpreted
> 
> I noticed that since some version of Struts2 it is now forbidden inside <s:
>> tag attributes.. right?
> 
> On Wed, Mar 19, 2008 at 2:54 PM, Dave Newton <ne...@yahoo.com> wrote:
> 
>> --- GF <ga...@gmail.com> wrote:
>>> Is this the standard JSP syntax?
>> 
>> JSP 2.0 EL.
>> 
>> Dave
>> 



This email and any attachments ("Message") may contain legally privileged and/or confidential information.  If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email.  Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.

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


Re: not interpreted

Posted by Dave Newton <ne...@yahoo.com>.
--- GF <ga...@gmail.com> wrote:
> I noticed that since some version of Struts2 it is now forbidden inside <s:
> tag attributes.. right?

Yep. Inside S2 tags use OGNL.

Dave


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


Re: not interpreted

Posted by GF <ga...@gmail.com>.
I noticed that since some version of Struts2 it is now forbidden inside <s:
> tag attributes.. right?

On Wed, Mar 19, 2008 at 2:54 PM, Dave Newton <ne...@yahoo.com> wrote:

> --- GF <ga...@gmail.com> wrote:
> > Is this the standard JSP syntax?
>
> JSP 2.0 EL.
>
> Dave
>

Re: not interpreted

Posted by Dave Newton <ne...@yahoo.com>.
--- GF <ga...@gmail.com> wrote:
> Is this the standard JSP syntax?

JSP 2.0 EL.

Dave


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


Re: not interpreted

Posted by Randy Burgess <RB...@nuvox.com>.
It is standard Expression Language (EL), which is much preferred over
scriptlets.  

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: GF <ga...@gmail.com>
> Reply-To: Struts Users Mailing List <us...@struts.apache.org>
> Date: Wed, 19 Mar 2008 14:44:08 +0100
> To: Struts Users Mailing List <us...@struts.apache.org>
> Subject: Re: <s:property in <s:*> not interpreted
> 
> Is this the standard JSP syntax?
> 
> On Mon, Mar 17, 2008 at 3:08 PM, Dave Newton <ne...@yahoo.com> wrote:
> 
>> --- GF <ga...@gmail.com> wrote:
>>>> ...unless you use the XML syntax available from JSP 2.0 and later ;-)
>>> And in this case, how can you resolve the <div id="<s:property... ?
>> 
>> <div id="${aProperty}"...>
>> 
>> Dave
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 



This email and any attachments ("Message") may contain legally privileged and/or confidential information.  If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email.  Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.

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


Re: not interpreted

Posted by GF <ga...@gmail.com>.
Is this the standard JSP syntax?

On Mon, Mar 17, 2008 at 3:08 PM, Dave Newton <ne...@yahoo.com> wrote:

> --- GF <ga...@gmail.com> wrote:
> > > ...unless you use the XML syntax available from JSP 2.0 and later ;-)
> > And in this case, how can you resolve the <div id="<s:property... ?
>
> <div id="${aProperty}"...>
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: not interpreted

Posted by Dave Newton <ne...@yahoo.com>.
--- GF <ga...@gmail.com> wrote:
> > ...unless you use the XML syntax available from JSP 2.0 and later ;-)
> And in this case, how can you resolve the <div id="<s:property... ?

<div id="${aProperty}"...>

Dave


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


Re: not interpreted

Posted by GF <ga...@gmail.com>.
>
>
> ...unless you use the XML syntax available from JSP 2.0 and later ;-)
>
>
And in this case, how can you resolve the <div id="<s:property... ?

Re: not interpreted

Posted by Manos Batsis <ma...@geekologue.com>.
Laurie Harper wrote:
> Dave Newton wrote:
>> --- matthieu martin <ma...@gmail.com> wrote:
>>>           <s:property id="<s:property value='id'/>" value="id"/>
>>
>> That's not valid XML; you can't nest tags like that. Off the top of my 
>> head I
>> don't recall if the "id" attribute will eval OGNL or not.
> 
> To be pedantic, JSPs are not XML files

...unless you use the XML syntax available from JSP 2.0 and later ;-)

Cheers,

Manos

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


Re: not interpreted

Posted by Laurie Harper <la...@holoweb.net>.
Dave Newton wrote:
> --- matthieu martin <ma...@gmail.com> wrote:
>>           <s:property id="<s:property value='id'/>" value="id"/>
> 
> That's not valid XML; you can't nest tags like that. Off the top of my head I
> don't recall if the "id" attribute will eval OGNL or not.

To be pedantic, JSPs are not XML files and thus don't have to be valid; 
hence <div id="<s:property... works. What is not legal in a JSP is 
nesting custom actions (i.e. those tags that get processed by the JSP 
compiler).

L.


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


Re: not interpreted

Posted by Dave Newton <ne...@yahoo.com>.
--- matthieu martin <ma...@gmail.com> wrote:
>           <s:property id="<s:property value='id'/>" value="id"/>

That's not valid XML; you can't nest tags like that. Off the top of my head I
don't recall if the "id" attribute will eval OGNL or not.

Dave


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


RE: property in not interpreted

Posted by "Allen, Daniel" <Da...@kbcfp.com>.
I actually thought you couldn't nest <s:*> tags. You can nest them in
regular HTML tags because the JSP and the HTML are interpreted at
different steps, so from the separate perspectives of the two parsers
there's not really any nesting going on (the JSP parser on the server
only cares about JSP tags, and the HTML parser on the browser only sees
the output).

Perhaps instead you could use an OGNL expression to concatenate the ID
onto the end of a string constant?

~DVA


-----Original Message-----
From: matthieu martin [mailto:matthieu832@gmail.com] 
Sent: Thursday, March 13, 2008 10:20 AM
To: user@struts.apache.org
Subject: <s:property in <s:*> not interpreted

Hi all !

I have a little issue and I find no clues on the web, so i'm turning
myself
to you.

I have a piece of code like this :


<div id="menu_image_gallerys<s:property value='id'/>">

          <s:property id="<s:property value='id'/>" value="id"/>

          <s:a theme="ajax" href="%{EditImageGallery}"
targets="dataImageDiv<s:property value='id'/>">Edit</s:a>

          <s:a theme="ajax" href="%{MoveImageGallery}"
targets="dataImageDiv<s:property value='id'/>">Move</s:a>

          <s:a theme="ajax" href="%{copyImageGallery}"
targets="dataImageDiv<s:property value='id'/>">Copy</s:a>

</div>

<div id="dataImageDiv<s:property value='id'/>" />



this piece of code is placed in a loop, and creates a small menu for
each
images I have in galleries. The dataImageDiv is used to contain whatever
form I need.

The problem is that my <s:property> tags contained in my <s:a> tags
aren't
interpreted. After few manipulations, I observed that the <s:property>
tag
is interpreted only if it's not contained in a struts tag. For instance
:

<div id="dataImageDiv<s:property value='id'/>" />

produces

<div id="dataImageDiv1" />

BUT

<s:div id="dataImageDiv<s:property value='id'/>" />

produces

<div id="dataImageDiv<s:property value='id'/>" />



Thus, my piece of code produces :

<div id="menu_image_gallerys1">

          1

          <s:a theme="ajax" href="%{EditImageGallery}"
targets="dataImageDiv<s:property value='id'/>">Edit</s:a>

          <s:a theme="ajax" href="%{MoveImageGallery}"
targets="dataImageDiv<s:property value='id'/>">Move</s:a>

          <s:a theme="ajax" href="%{copyImageGallery}"
targets="dataImageDiv<s:property value='id'/>">Copy</s:a>

</div>

<div id="dataImageDiv1/>



As I'm using this in a loop, it's obviously not working, the targets and
the
divs not matching.

This is driving me nuts. Do I do something wrong ? Would you have an
idea ?
The <s:head theme="ajax"/> is well included in my header.

Thanks in advance,



Matthieu

-- 
This message may contain confidential, proprietary, or legally privileged information. No confidentiality or privilege is waived by any transmission to an unintended recipient. If you are not an intended recipient, please notify the sender and delete this message immediately. Any views expressed in this message are those of the sender, not those of any entity within the KBC Financial Products group of companies (together referred to as "KBC FP"). 

This message does not create any obligation, contractual or otherwise, on the part of KBC FP. It is not an offer (or solicitation of an offer) of, or a recommendation to buy or sell, any financial product. Any prices or other values included in this message are indicative only, and do not necessarily represent current market prices, prices at which KBC FP would enter into a transaction, or prices at which similar transactions may be carried on KBC FP's own books. The information contained in this message is provided "as is", without representations or warranties, express or implied, of any kind. Past performance is not indicative of future returns.


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