You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by sim085 <si...@hotmail.com> on 2006/06/23 11:19:50 UTC
Tiles & action classes
Hello,
Tiles is part of the Struts Framework that is why I tought of asking this
here.
Basically I have a page that is made from a menu section and a view section.
The view section changes all the time. However now I wish to add an action
and a form bean for my menu as well.
I had read once that you can set these in the tiles.config file. However I
do not know exactly how. Can some one please help me by leading me to
examples?
regards,
sim085
--
View this message in context: http://www.nabble.com/Tiles---action-classes-t1835228.html#a5008671
Sent from the Struts - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [tiles] Re: Tiles & action classes
Posted by sim085 <si...@hotmail.com>.
Thanks :) no it is not is sounds strange, just I did not think that two
actions could be called on the same page unless I did something out of the
ordinary!! :)
Okej I will do it that way and see how it goes :)
thanks and regards,
sim085
--
View this message in context: http://www.nabble.com/Tiles---action-classes-t1835228.html#a5011132
Sent from the Struts - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [tiles] Re: Tiles & action classes
Posted by Antonio Petrelli <br...@tariffenet.it>.
sim085 ha scritto:
> Thanks, you already helped me much with that last peace of code.
>
> No my menu does not change from page to page. It is always the same menu?
> That means I can avoid changing my tiles-config? and if so, what do I
> change then. I just define a new action in my struts-config, and define the
> form to be used, and naturally use the struts jstl in the menu.jsp page?
>
Yes! Does it sound so strange? :-P
Unless you have something very odd, such as a form that is declared
across JSP pages (the start in one tile and the end in another), that
anyway is not advisable, everything will work.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [tiles] Re: Tiles & action classes
Posted by sim085 <si...@hotmail.com>.
Thanks, you already helped me much with that last peace of code.
No my menu does not change from page to page. It is always the same menu?
That means I can avoid changing my tiles-config? and if so, what do I
change then. I just define a new action in my struts-config, and define the
form to be used, and naturally use the struts jstl in the menu.jsp page?
thanks and regards,
sim085
--
View this message in context: http://www.nabble.com/Tiles---action-classes-t1835228.html#a5010933
Sent from the Struts - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [tiles] Re: Tiles & action classes
Posted by Antonio Petrelli <br...@tariffenet.it>.
sim085 ha scritto:
> Now, each view is using an Action class to manage the view and so on. I
> would like to have another action class for the menu section as well, with a
> form bean to transfer the data from the menu to the action class and back
> again.
>
If the JSP of the menu does not change, you can define your action
without modifing tiles-defs.xml.
If you need to change the menu JSP, you should make an additional action
that acts as a dispatcher. You can put the action path instead of the
JSP page in your definition.
For example:
<put name="menu" value="/menuAction.do" />
The /menuAction.do mapping must point to a real action, that forwards
to, for example, a JSP page that will be put in the place of the menu.
HTH
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: [tiles] Re: Tiles & action classes
Posted by sim085 <si...@hotmail.com>.
Okej,
Basically my page is divided into two sections. On the left I have a menu,
and on the right I have my view. Now, using tiles, I am loading the menu
from a jsp page, and the view according to the required page.
in the tiles.config file I defined a base definition (that defines the menu
and an empty view) and all the other tiles inherit from this base
definition.
Now, each view is using an Action class to manage the view and so on. I
would like to have another action class for the menu section as well, with a
form bean to transfer the data from the menu to the action class and back
again.
This means that I will have one page with one action class. I do not know
if it is possible however I really need to add some logic for my menu object
to be handled by the application backend.
regards,
sim085
--
View this message in context: http://www.nabble.com/Tiles---action-classes-t1835228.html#a5010508
Sent from the Struts - User forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
[tiles] Re: Tiles & action classes
Posted by Antonio Petrelli <br...@tariffenet.it>.
sim085 ha scritto:
> Hello,
>
> Tiles is part of the Struts Framework that is why I tought of asking this
> here.
>
You're right :-)
> Basically I have a page that is made from a menu section and a view section.
> The view section changes all the time. However now I wish to add an action
> and a form bean for my menu as well.
>
> I had read once that you can set these in the tiles.config file. However I
> do not know exactly how. Can some one please help me by leading me to
> examples?
>
I don't think you need to modify the tiles-defs.xml at all. Configure
your new action and your form beans as usual. But maybe you need
something different, i.e. maybe you don't need simply to manage a new
action... Can you explain what you exactly want to do?
Ciao
Antonio
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org