Hi,

I was doing some strange thing in there, I wanted to use nested layouts,
but I finally solved that, by using just render tags in the main, and
definition in the sub layouts.

When I have time I will make test cases to get it clear,

Thank you!

Javier Domingo


2012/4/18 Shawn Church <sh...@redarbor.com>

> I don't quite understand your goals here, but generally you'll want to
> have a container layout definition which includes things like
> navigation, common page logos, etc.  This layout will also provide
> areas where content from other pages may be placed, using the
> layout-component tag.  Optionally, layout-component may render other
> content directly, by name, which I think you are trying to do with
> topbar.jsp.
>
> For example, main_layout.jsp may look like this:
>
> <s:layout-definition>
>   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd";>
>   <html>
>   <head>
>   </head>
>   <body>
>
>   <s:layout-component name="header">
>     <s:layout-render name="/WEB-INF/layout/header.jsp"/>
>   </s:layout-component>
>
>   <table>
>     <tr>
>       <td width="165">
>         <s:layout-component name="nav">
>           <s:layout-render name="/WEB-INF/layout/nav.jsp"/>
>         </s:layout-component>
>       </td>
>       <td>
>         <s:layout-component name="contents"/>
>       </td>
>     </tr>
>   </table>
>
>   <s:layout-component name="header">
>     <s:layout-render name="/WEB-INF/layout/footer.jsp"/>
>   </s:layout-component>
>
>   </body>
>   </html>
> </s:layout-definition>
>
>
> In this example, /WEB-INF/layout.header.jsp, nav.jsp, and footer.jsp
> are rendered directly.  The <s:layout-component name="contents"/> is
> where other pages may insert their content into main_layout.jsp, such
> as this:
>
> some_other_page.jsp:
>
> <s:layout-render name="/WEB-INF/layout/main_layout.jsp">
>  <s:layout-component name="contents">
>     ( normal HTML goes here and will be rendered into "contents" of
> main_layout.jsp )
>  </s:layout-component>
> </s:layout-render>
>
> Your java code will reference "some_other_page.jsp" when using
> ForwardResolution or RedirectResolution.  You would normally never
> reference "main_layout.jsp" in your Java code, but only from other jsp
> pages.
>
> And yes, as you can see from these examples, you can reference
> /WEB-INF without using absolute paths.  Also, be careful to be
> consistent in naming (TopBar.jsp vs. topbar.jsp).
>
>
> Quoting Javier Domingo <javier...@gmail.com>:
>
> > Hi,
> >
> > I am developing a web app, and I want to use the Nested Layouts feature.
> > But in the docs I don't see it very clear, if I have:
> >
> > in main_layout.jsp
> >
> >>             <div id="menu">
> >>                 <stripes:layout-component name="topbar">
> >>                     <jsp:include page="TopBar.jsp"/>
> >>                 </stripes:layout-component>
> >>             </div>
> >
> >
> > I should put in TopBar.jsp
> >
> >> <stripes:layout-definition>
> >>     <stripes:layout-component name="TopBar">
> >>         <ul><li>Elem1</li></ul>
> >>     </stripes:layout-component>
> >
> > </stripes:layout-definition>
> >
> >
> > or just the html stuff? And if I don't want to make the layout jsp
> > available, can I use relative paths? I say this because I work inside
> > WEB-INF and map the .jsp in .html
> >
> > Greetings,
> >
> > Javier Domingo
> >
>
>
>
>
> ------------------------------------------------------------------------------
> Better than sec? Nothing is better than sec when it comes to
> monitoring Big Data applications. Try Boundary one-second
> resolution app monitoring today. Free.
> http://p.sf.net/sfu/Boundary-dev2dev
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
------------------------------------------------------------------------------
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to