You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Klaasjan Brand <br...@topicus.nl> on 2002/05/13 12:52:37 UTC
bug in tiles controllerClass option?
Hi there,
I'm trying to assign a Struts action to a tile. I've tried controllerUrl
to a struts action and setting controllerClass to the same Action, but
the response I get is that I have to extend Action or implement Controller.
When I changed the Action to implement Controller it works, but now I'm
wondering how to pass request parameters to the class...
greets,
Klaasjan
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: bug in tiles controllerClass option?
Posted by Cedric Dumoulin <ce...@lifl.fr>.
Normally, you can use a Struts action as a tiles controller with no
modification. You should specify only one attribute controllerClass OR
controllerURL. If problem persists, it should be a bug ;-)
Here is an abstract of the (not officially released) documentation :
(http://www.lifl.fr/~dumoulin/tiles/tilesAdvancedFeatures.pdf chapter 5.2)
.........
If you use a class name as controller, it should extends one of the following
base class or interface :
* org.apache.struts.tiles.Controller
o This is the Controller interface defining the controller method. This
method receives as arguments the current Tile's context, and usual
servlet parameters request, response and servletContext.
* org.apache.struts.tiles.ControllerSupport
o This is a basic implementation with an empty method.
* org.apache.struts.action.Action (wrapper
org.apache.struts.action.StrutsActionControllerWrapper is used)
o If you provide a Struts Action subclass, it will be wrapped with
appropriate class, and Struts' perform method will be called, but
"mapping" and "form" attribute will be null.
Example of a controller inserted as a class :
<tiles:insert page="layout.jsp"
controllerClass="org.apache.struts.example.tiles.test.TestTileController" >
<tiles:put name="title" value="Test controller set in insert" />
<tiles:put name="header" value="header.jsp" />
<tiles:put name="body" value="body.jsp" />
</tiles:insert>
..........
Hope this help,
Cedric
Klaasjan Brand wrote:
> Hi there,
>
> I'm trying to assign a Struts action to a tile. I've tried controllerUrl
> to a struts action and setting controllerClass to the same Action, but
> the response I get is that I have to extend Action or implement Controller.
> When I changed the Action to implement Controller it works, but now I'm
> wondering how to pass request parameters to the class...
>
> greets,
> Klaasjan
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>