You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by mech <me...@rz.fh-augsburg.de> on 2003/04/17 16:38:25 UTC

RE: coming from .do file stops further template processing. Resolved!

Finally I found out what was the problem. I should not have used 

return (mapping.findForward("view"));

in my Action-Klasse execute(). Instead I use NO view at all by simply:
return null;

And I just let the insert tag call the controller: 
<tiles:insert page="/template/layout.jsp"
controllerUrl="/template/navigation.do" flush="false">
...
...
  <tiles:put name"topnavi" value="/template/topnavi.jsp" type="page"/>

Michael

> -----Original Message-----
> From: mech [mailto:mech@RZ.FH-Augsburg.DE] 
> Sent: Donnerstag, 17. April 2003 03:44
> To: 'Struts Users Mailing List'
> Subject: RE: <TILES:PUT> coming from .do file stops further 
> template processing. Only possible to use .jsp?
> 
> 
> Tried Struts 1.1rc1. No change compared to 1.1b2. 
> After the first .do that I try to <tiles:put> my page stops 
> processing further includes. Also doesn't change anything if 
> I replace <tiles:get name=> in my master layout against 
> <tiles:insert attribute=>
> 
> I only want to include the output of a view that is called by an
> action.execute() instead of a straighforward .jsp include 
> because I need to process something before I can generate the view.
> 
> My layout /template/layout.jsp looks like this:
> 
> 
> title
> +---------+---------------------+
> |(Image)  |titlebar             |
> +---------+---------------------+
> |         | topnavi             |
> |         +---------------------|
> |         |header       | status|
> |leftnavi +---------------------+   
> |         | maincontent         |
> |         |                     |
> |         |                     |
> |         |                     |
> |         |                     |
> |         +---------------------|
> |         | footer              |
> +---------+---------------------+
> 
> But as soon as I exchange my topnavi.jsp with a .do file 
> which forwards to a jsp...
> 
> <tiles:insert page="/template/layout.jsp" flush="false">
>   ...
>   <tiles:put name="topnavi"> 
> value="/template/def_topnavi.jsp" type="page"/>
>   ...with...
>   <tiles:put name="topnavi"> value="/template/def_topnavi.do" 
> type="page"/>
>   ...
> </tiles:insert>
> 
> def_topnavi.do -> Action.execute() -> View: /template/def_navi.jsp
> 
> 
> +---------+---------------------+
> |(Image)  |titlebar             |
> +---------+---------------------+
> |         |topnavi(def_navi.jsp)|
> |         +---------------------|
> |                               |
> |         blank                 |
> |                               |
> |                               |
> +-------------------------------+
> 
> 
> I wonder how I can get the rest of my page...
> Michael
> 
> 
> > -----Original Message-----
> > From: mech [mailto:mech@rz.fh-augsburg.de]
> > Sent: Donnerstag, 17. April 2003 02:15
> > To: 'Struts Users Mailing List'
> > Subject: RE: <TILES:PUT> coming from .do file stops further 
> > template processing. Only possible to use .jsp?
> > 
> > 
> > I use Struts 1.1b2. I tested the action standalone, the view
> > exists, too... I receive output, the action is called, too as 
> > I can see from my log. Only loading in the tiles def doesn't 
> > work. Guess some kind of inclusion/flush problem. Something 
> > new with Struts 1.1b3 and tiles?
> > 
> > 
> > I have this in my struts-config.xml:
> > 
> > <form-bean
> > 		name="NavigationForm"
> > 		type="praksis.navigation.NavigationForm"/>
> > 
> > 
> > <action 
> > 		path="/template/def_topnavi" 
> > 		type="praksis.navigation.NavigationAction"
> > 		name="NavigationForm"
> > 		scope="request">
> > 		<forward name="view"
> > path="/template/def_navi.jsp?status=top"/>
> > 	</action>
> > 	
> > 	<action 
> > 		path="/template/def_leftnavi" 
> > 		type="praksis.navigation.NavigationAction"
> > 		name="NavigationForm"
> > 		scope="request">
> > 		<forward name="view"
> > path="/template/def_navi.jsp?status=left"/>
> > 	</action>
> > 
> > 
> > When I use this, I see my layout, but the processing stops
> > just after that "put" command that is utilizing the first 
> > ".do". The output of the /template/dev_navi.jsp is in the 
> > table cell. But that doesn't help much if the rest doesn't 
> > get included anymore.
> > 
> > I tried to put an attribute redirect="true" into each
> > <forward>. The result was that my layout was rendered fully, 
> > the content was put into place, but the two navigation areas 
> > where blank this time. But since the def_navi.jsp didn't 
> > chance, I can only suppose that the output of it got lost.
> > 
> > Any other ideas, since that does not seem to be the problem...?
> > 
> > Michael
> > 
> > > -----Original Message-----
> > > From: Cedric Dumoulin [mailto:cedric@apache.org]
> > > Sent: Donnerstag, 17. April 2003 00:16
> > > To: Struts Users Mailing List
> > > Subject: Re: <TILES:PUT> coming from .do file stops further
> > > template processing. Only possible to use .jsp?
> > > 
> > > 
> > > 
> > >   Hi,
> > > 
> > >   It is possible to use .do in <tiles:put> tags.
> > >   Don't forget to check if the corresponding action exist 
> and can be 
> > > created, and if the action has some or at least one 
> forward to show 
> > > something.
> > > 
> > >    Cedric
> > > 
> > > mech wrote:
> > > 
> > > >Hi,
> > > >
> > > >I wonder, if it is possible to use a .do file as source for a 
> > > ><tiles:put>. I only had it done with .jsp so far. I would
> > > like to use
> > > >the MVC pattern also with tiles to retrieve the content for 
> > > ><tiles:put>.
> > > >
> > > >
> > > >I want to check if this is theoretically possible. If yes
> > what setup
> > > >needs to be done, because I can't get it work with just
> > > loading a .do
> > > >file.
> > > >
> > > >To explain it more in detail:
> > > >
> > > >
> > > >I use the TILES taglib for a common layout which contains of two 
> > > >navigation areas, some content, header, footer etc. So I
> > > have two files
> > > >for every view, I only replace the file "my_content.jsp"
> > and some of
> > > >the string fields.
> > > >
> > > ><tiles:insert page="/template/layout.jsp" flush="false">
> > > >	<tiles:put name="title" value="blabla" type="string"/>
> > > >	<tiles:put name="titlebar" value="/template/def_titlebar.jsp"
> > > >type="page"/>
> > > >	<tiles:put name="topnavi"
> > > value="/template/def_topnavi.jsp (or .do)"
> > > >type="page"/>
> > > >	<tiles:put name="leftnavi"
> > > value="/template/def_leftnavi.jsp (or .do)"
> > > >type="page"/>
> > > >	<tiles:put name="header" value="<b><u>Headline:</u></b>" 
> > > >type="string"/>
> > > >	<tiles:put name="status" value="/template/def_status.jsp"
> > > >type="page"/>
> > > >	<tiles:put name="maincontent" value="/info/my_content.jsp" 
> > > >type="page"/>
> > > >	<tiles:put name="footer" value="/template/def_footer.jsp" 
> > > >type="page"/> </tiles:insert>
> > > >
> > > >In my layout.jsp I have all the html tables and
> > <tiles:get> tags, of
> > > >course.
> > > >
> > > >
> > > >
> > > >Recently I tried to replace "/def_topnavi.jsp" and
> > > "/def_leftnavi.jsp"
> > > >with two .do files... Mainly I want to process a xml file
> > > containing my
> > > >navigation links, put it into an ActionForm and give it 
> to a JSP to 
> > > >display. Until now I did that in the JSPs with the help of
> > "normal"
> > > >JavaBeans. But I think using .do might be more convenient.
> > > >
> > > >My Action.execute() should forward to the view which is
> > > displaying the
> > > >top area...  Unfortuntely after "/def_topnavi.do" the TILES
> > > tags seems
> > > >to stop processing any further.
> > > >
> > > >I can only suggest that this is due to flushing the output
> > > stream after
> > > >.do or it's view has been executed. But no idea.
> > > >I even tried 	redirect="true"	in the "view"-forward of my
> > > >struts-config.xml. Then I get a complete layout, but the 
> navigation 
> > > >area is simply empty, as if the view never did anything.
> > > >
> > > >
> > > >Generally speaking. Is it possible to use .do files with
> > > <tiles:put>.
> > > >Anyone having success with it? If yes, what to setup. Maybe in 
> > > >struts-config.xml?
> > > >
> > > >Thanks
> > > >Michael
> > > >
> > > >
> > > >
> > > 
> > 
> >---------------------------------------------------------------------
> > > >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