struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gopalakrishnan, Jayesh" <Jayesh.Gopalakrish...@schwab.com>
Subject RE: Query String for tiles
Date Fri, 06 Feb 2004 23:48:48 GMT
typo in my previous email.

should have been..
<forward name="startapp" path="/do/go/whatever?remember=test001"></forward>


-----Original Message-----
From: Gopalakrishnan, Jayesh 
Sent: Friday, February 06, 2004 3:47 PM
To: Struts Users Mailing List
Subject: RE: Query String for tiles


You could create an forward-action for the JSP.

<action path="/go/whatever" 
 type="org.apache.struts.actions.ForwardAction" 
 parameter="tiles.self.effort"/>


And modify the <foward> in your action to,

<forward name="startapp" path="/do/go/faq?remember=test001"></forward>

This may not fit within the "best practices".....but will get it done.

hth
-jayash



-----Original Message-----
From: news [mailto:news@sea.gmane.org]On Behalf Of Wayne Kidd
Sent: Friday, February 06, 2004 3:42 PM
To: struts-user@jakarta.apache.org
Subject: Re: Query String for tiles


There is no include anywhere in my app.  I am just combining tiles (jspf 
is the name of fragments of jsp pages)to build up the page.  Top level 
of the page is a .jsp with a bunch of tiles:insert tags filling out the 
cells of a table.  I just want to dynamically build a query string for 
the top-level page so that there is something useful in the browser url 
when the session expires.

Wayne

Anand Patil wrote:
> I am confused. What I meant was that you are using a jsp or some form of
> jsp (judging by the extension as jspf) to render the body of the tile.
> The logic (if I may) must be that the jsp attached on the tile , will
> include the body attribute as a dynamic include. All I could think of is
> that you need to PASS 'remember' as a parameter to that jsp. My solution
> assumes that and hence says u have to use a tile controller to transfer
> attributes from request to the tile context. 
> 
> Am I missing something? 
> 
> Anand.
> 
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Wayne Kidd
> Sent: Friday, February 06, 2004 1:24 PM
> To: struts-user@jakarta.apache.org
> Subject: Re: Query String for tiles
> 
> 
> If I were using a straight action, I would simply get the path from my 
> ActionForward  subclass and append the query string to it.  This seems 
> ponderous for placing a parameter in the url.
> 
> Is there any other way?
> 
> Wayne
> 
> Anand Patil wrote:
> 
>>I assume you want to pass the query string "remember=test001" to 
>>"/pages/time_inputeffort_body_nested.jspf". One way I can think of is 
>>put the "remember=test001" as a request attribute in the logic of 
>>com.rdlogic.struts.control.LoginAction.
>>
>>try reading the attribute directly from the request, since tiles does 
>>"include" , you share the same request. So you could probably use 
>>request.getAttribute()" ;
>>
>>If that does not work use the tile controller concept
>>
>>Put a controller on the definition "tiles.self.effort". Your 
>>definition modifies as
>>
>>
>><definition name="tiles.self.effort" extends="tiles.full.layout" 
>>controllerUrl="/tilecontroller.do">
>><put name="head.title" value="/pages/title.jspf"/>
>><put name="body"
> 
> value="/pages/time_inputeffort_body_nested.jspf"></put>
> 
>></definition>
>>
>>In your struts-config.xml add this.
>><action path="/tilecontroller" 
>>type="<yourclasswhichextendstileaction"/>
>>
>>Make sure ur tile controller extends from TilesAction
>>
>>In your tilecontroller guy u can get the attribute from the request 
>>and put in the tilecontext and in your jsp for the tile you can use 
>><tiles:useattribute/> look @ tiles documentation to figure how to use 
>>the tag. Then get that value and pass it to your jsp include via 
>><jsp:include/> tag.
>>
>>HTH
>>
>>Anand.
>>
>>-----Original Message-----
>>From: news [mailto:news@sea.gmane.org] On Behalf Of Wayne Kidd
>>Sent: Friday, February 06, 2004 11:44 AM
>>To: struts-user@jakarta.apache.org
>>Subject: Query String for tiles
>>
>>
>>Is it possible to attach a query string to a tiles forward.
>>
>>my struts-config.xml has an entry like
>>
>><action path="/login" name="login"
>>type="com.rdlogic.struts.control.LoginAction" >
>><forward name="startapp" path="tiles.self.effort"></forward>
>><forward name="userForInput" path="tiles.self.effort"></forward>
>><forward name="showlogin" path="tiles.login"></forward> </action>
>>
>>My Tiles-defs.xml has an entry like
>>
>><definition name="tiles.self.effort" extends="tiles.full.layout"> <put
> 
> 
>>name="head.title" value="/pages/title.jspf"/> <put name="body" 
>>value="/pages/time_inputeffort_body_nested.jspf"></put>
>></definition>
>>
>>
>>I want the net result of forward "startapp" to have a query string 
>>like
>>
>>"?remember=test001"
>>
>>I want the remember to be dynamically settable (during the execution 
>>of
>>the LoginAction code I want to pick whether it is "test001" or
> 
> "test002"
> 
>>
>>Anybody know a way.
>>
>>Wayne
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org



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

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

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


Mime
View raw message