Re: S2: s:include tag and s:param

2008-07-29 Thread Eric Nielsen
So I tried the param. access path last night.  That wasn't working, the
documentation referenced a parameters. instead.  I managed to get that working
with s:component, but no luck with s:include.

I don't really care if I use component versus include; however I liked the
include slightly better since I was easily able to place my jsp
fragment/component underneath WEB-INF.  When I tried using struts.ui.templateDir
to move the template directory used by s:component under WEB-INF, it appears to
break all the regular struts 2 tags.  Is there a good way of locating
application custom templates underneath WEB-INF without breaking the search path
for the existing tag/themes?

Eric



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: S2: s:include tag and s:param

2008-07-28 Thread Dave Newton
--- On Sun, 7/27/08, Dave Newton [EMAIL PROTECTED] wrote:
 (That being said, as this question seems to come up rather
 frequently, maybe the include tag should add its params to
 the request used for the include, if that's possible?)

It already does; not sure what I was thinking there. (I do know; I was looking 
at the wrong code.)

I'm able to access parameters set via a nested s:param.../ using both c:out 
value=${param.foo}/ and ${param.foo}. 

If the value is coming from the action then you shouldn't even need to set it 
via an s:param.../ since the value stack is available in included 
pages--action properties are available via both S2 tags and EL (via the custom 
request hoobie-doobie).

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: S2: s:include tag and s:param

2008-07-28 Thread Eric Nielsen
Dave Newton newton.dave at yahoo.com writes:
 It already does; not sure what I was thinking there. (I do know; I was looking
at the wrong code.)
 
 I'm able to access parameters set via a nested s:param.../ using both c:out
value=${param.foo}/
 and ${param.foo}. 
 
 If the value is coming from the action then you shouldn't even need to set it
via an s:param.../ since the
 value stack is available in included pages--action properties are available
via both S2 tags and EL (via
 the custom request hoobie-doobie).

OK I'm now a little confused.  It sounds like you're reversing yourself from the
first reply and that what I was trying should work?  Can you see something
different between your test case and the code I sent before?  

I can't use use the action's properties, since different actions back the
different views that use this snippet.  In all cases the needed property is
navigateable from exposed properties, however.  Hence the desire to use the
include to effectively rename the property from the main result jsp to the
included snippet.

Eric


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: S2: s:include tag and s:param

2008-07-28 Thread Dave Newton
--- On Mon, 7/28/08, Eric Nielsen [EMAIL PROTECTED] wrote:
 Dave Newton newton.dave at yahoo.com writes:
  It already does; not sure what I was thinking there.
 (I do know; I was looking
 at the wrong code.)
  
  I'm able to access parameters set via a nested
 s:param.../ using both c:out
 value=${param.foo}/
  and ${param.foo}. 
 
 OK I'm now a little confused.  It sounds like you're reversing
 yourself from the first reply and that what I was trying should work?

Yeah, that was why I said not sure what I was thinking (but I do know; I was 
looking at the wrong method).

 Can you see something different between your test case and 
 the code I sent before?  

I used the word param in my EL.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: S2: s:include tag and s:param

2008-07-28 Thread Becky . L . O'Sullivan
Yes you can access them via JSTL, like Dave mentioned (using ${param.xx} ),
but not via OGNL.
If you want to access those params via OGNL use JSTL to set them into the
page scope, then use #attr to get them.
I hate JSTL's choose/otherwise tags, and prefer struts if/else tags, so I
use this a lot in that situation.


s:include value=/WEB-INF/components/competitions/identity-readonly.jsp
  s:param name=comp value=competition /
/s:include



%@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core; %
c:set var=comp value=${param.comp}/

div class=primaryBox
  h1Competition Information/h1
  s:property escape=false value=#attr.comp /
/div











   
 Dave Newton   
 [EMAIL PROTECTED] 
 o.com To 
   Struts Users Mailing List   
 07/28/2008 07:18  user@struts.apache.org
 AM cc 
   
   Subject 
 Please respond to Re: S2: s:include tag and s:param   
   Struts Users   
   Mailing List   
 [EMAIL PROTECTED] 
  he.org  
   
   




--- On Mon, 7/28/08, Eric Nielsen [EMAIL PROTECTED] wrote:
 Dave Newton newton.dave at yahoo.com writes:
  It already does; not sure what I was thinking there.
 (I do know; I was looking
 at the wrong code.)
 
  I'm able to access parameters set via a nested
 s:param.../ using both c:out
 value=${param.foo}/
  and ${param.foo}.

 OK I'm now a little confused.  It sounds like you're reversing
 yourself from the first reply and that what I was trying should work?

Yeah, that was why I said not sure what I was thinking (but I do know; I
was looking at the wrong method).

 Can you see something different between your test case and
 the code I sent before?

I used the word param in my EL.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.

-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: S2: s:include tag and s:param

2008-07-28 Thread Dave Newton
--- On Mon, 7/28/08, Becky.L.O'[EMAIL PROTECTED] wrote:
 If you want to access those params via OGNL use JSTL to set
 them into the page scope, then use #attr to get them.

Or in request scope, then you don't need to specify scope or #attr, IIRC.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: S2: s:include tag and s:param

2008-07-27 Thread Dave Newton
IIRC the s:param.../ tag is for parameterizing components; AFAIK it doesn't 
add anything to a scope.

(That being said, as this question seems to come up rather frequently, maybe 
the include tag should add its params to the request used for the include, if 
that's possible?)

Dave

--- On Sun, 7/27/08, Eric D Nielsen [EMAIL PROTECTED] wrote:
 I've been having trouble getting s:include and s:param to work.
 
 I have a snippet I want to include in multiple pages.  This
 snippet will want to make use of Struts 2 tags and OGNL, 
 though at present I just need a simple c:out.
 
 The snippet looks like:
 %@ taglib prefix=c
 uri=http://java.sun.com/jsp/jstl/core; %
 div class=primaryBox
   h1Competition Information/h1
   c:out value=${comp.name} /
 /div
 - END --
 
 I'm currently using it with:
 s:include
 value=/WEB-INF/components/competitions/identity-readonly.jsp
 s:param name=comp
 value=competition /
 /s:include
  END -
 
 The c:out isn't printing anything.
 
 I've tried using ${} notation in the param value; that
 doesn't lead any
 different behavoir for me.
 
 If I reference competition.name in the snippet and skip the
 s:param, everything
 works on this page (because the action exposes the
 competition property. 
 However other pages that include it will not expose it
 directly (but I can
 navigate to it from properties that are exposed).
 
 What am I missing?
 
 Eric


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]