You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Andreas Imner <an...@passagen.se> on 2007/03/27 15:31:57 UTC

Can I force Struts2 to use Tiles(1)??

Using Google, I have found some threads about using Tiles with Struts2, 
but they all seem to involve using Tiles2 and not Tiles(1)
(http://www.mail-archive.com/user@struts.apache.org/msg56425.html and 
http://www.mail-archive.com/user@struts.apache.org/msg56532.html)

Currently, I cannot forward to a Tiles-template when my definition tag 
looks like this:

<definition name="view.teststruts2andtiles" path="
/layout/teststruts2andtiles.jsp"/>

causes
org.apache.tiles.TilesException
	at org.apache.tiles.impl.BasicTilesContainer.render
(BasicTilesContainer.java:403)

However, if I change it to using the template -attribute instead, it 
works fine
<definition name="view.teststruts2andtiles" template="
/layout/teststruts2andtiles.jsp"/>

As the usage of the template-attribute is defined in the tiles2-DTD, I 
suspect that Tiles2 is used by my application and not Tiles(1)

How can I make sure that Tiles1 is used in my Struts2 application? Or 
is it not possible?

Many thanks in advance  / Andreas

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


Re: Can I force Struts2 to use Tiles(1)??

Posted by Greg Reddin <gr...@gmail.com>.
On 3/27/07, Andreas Imner <an...@passagen.se> wrote:
>
> Using Google, I have found some threads about using Tiles with Struts2,
> but they all seem to involve using Tiles2 and not Tiles(1)


To my knowledge there is no way to use Struts 2 with Tiles 1.  If you
*require* Tiles 1 it would probably not be too difficult to write a plugin,
but integrating the libraries might be a bit more difficult.  If you're
having trouble getting Tiles 2 to work, but you have the patience to work
with it a bit you should ask some questions on the Tiles user list (
users@tiles.apache.org).  We could probably help you get things going and
explain the differences between version 1 and 2.

HTH,
Greg

RE: Session not set before prepare() function with Struts 2 prepare interceptor

Posted by Jason Wyatt <jw...@itree.com.au>.
Thanks Rohit,  moving the default stack before the prepare was a good idea,
works fine. 

Regards
Jason


-----Original Message-----
From: Rohit Dewan [mailto:dewanr@gmail.com] 
Sent: Wednesday, 28 March 2007 4:01 PM
To: Struts Users Mailing List
Subject: Re: Session not set before prepare() function with Struts 2 prepare
interceptor

Hi Jason,

I believe it is the servlet-config interceptor that is responsible for
setting the session. I think it is part of the defaultStack. Try moving the
defaultStack before prepare in your configuration. That might do the job.

Regards,
Rohit

On 3/27/07, Jason Wyatt <jw...@itree.com.au> wrote:
>
>
> Hi,
>
> I'm trying to use the "prepare" interceptor in Struts 2, and although 
> the Action's prepare() function IS being called, the session doesn't 
> seem to be set on the action before the prepare() function is called.
>
> The action implements SessionAware, and has a setSession(Map session) 
> function. The session aware part was working for the execute() function.
>
> Do I need to add another interceptor to the action's interceptor stack 
> before the prepare interceptor?
>
> Here is the Action's interceptor stack:
>
>     <interceptor-stack name="userprep" >
>         <interceptor-ref name="authentication" />
>         <interceptor-ref name="prepare" />
>         <interceptor-ref name="defaultStack"/>
>     </interceptor-stack>
>
> Thanks in advance for any help, regards
>
> Jason
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Itree Software         www.itree.com.au
> Ph (02)42263454        Fax (02)42263193
>         -> Meeting your requirements.
>         -> Delivering on promises.
>         -> Pride in our work.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



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


Re: Session not set before prepare() function with Struts 2 prepare interceptor

Posted by Rohit Dewan <de...@gmail.com>.
Hi Jason,

I believe it is the servlet-config interceptor that is responsible for
setting the session. I think it is part of the defaultStack. Try moving the
defaultStack before prepare in your configuration. That might do the job.

Regards,
Rohit

On 3/27/07, Jason Wyatt <jw...@itree.com.au> wrote:
>
>
> Hi,
>
> I'm trying to use the "prepare" interceptor in Struts 2, and although the
> Action's prepare() function IS being called, the session doesn't seem to
> be
> set on the action before the prepare() function is called.
>
> The action implements SessionAware, and has a setSession(Map session)
> function. The session aware part was working for the execute() function.
>
> Do I need to add another interceptor to the action's interceptor stack
> before the prepare interceptor?
>
> Here is the Action's interceptor stack:
>
>     <interceptor-stack name="userprep" >
>         <interceptor-ref name="authentication" />
>         <interceptor-ref name="prepare" />
>         <interceptor-ref name="defaultStack"/>
>     </interceptor-stack>
>
> Thanks in advance for any help, regards
>
> Jason
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Itree Software         www.itree.com.au
> Ph (02)42263454        Fax (02)42263193
>         -> Meeting your requirements.
>         -> Delivering on promises.
>         -> Pride in our work.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Session not set before prepare() function with Struts 2 prepare interceptor

Posted by Dave Newton <ne...@yahoo.com>.
--- Jason Wyatt <jw...@itree.com.au> wrote:
>     <interceptor-stack name="userprep" >
>         <interceptor-ref name="authentication" />
>         <interceptor-ref name="prepare" />
>         <interceptor-ref name="defaultStack"/>
>     </interceptor-stack>

Your question was already answered, but I'd add that
normally "prepare" is already part of "defaultStack".

d.



 
____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html 

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


Session not set before prepare() function with Struts 2 prepare interceptor

Posted by Jason Wyatt <jw...@itree.com.au>.
Hi, 

I'm trying to use the "prepare" interceptor in Struts 2, and although the
Action's prepare() function IS being called, the session doesn't seem to be
set on the action before the prepare() function is called. 

The action implements SessionAware, and has a setSession(Map session)
function. The session aware part was working for the execute() function. 

Do I need to add another interceptor to the action's interceptor stack
before the prepare interceptor?

Here is the Action's interceptor stack:

    <interceptor-stack name="userprep" >
        <interceptor-ref name="authentication" />
        <interceptor-ref name="prepare" />
        <interceptor-ref name="defaultStack"/>
    </interceptor-stack>

Thanks in advance for any help, regards

Jason


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Itree Software		www.itree.com.au
 Ph (02)42263454  	Fax (02)42263193
 	-> Meeting your requirements. 
 	-> Delivering on promises. 
	-> Pride in our work.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 




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