Thiago, I don't think it's possible to define the needed JS and CSS files in your 'weather' component, you need to code it explicitly in your JSP page.
Thus you're 'some web page' needs to look like this: <stripes:layout-render name="/template/main.jsp"> <stripes:layout-component name="content"> <stripes:layout-render name="/component/weather.jsp" /> </stripes:layout-component> <stripes:layout-component name="css"> <link rel="stylesheet" type="text/css" href="${contextPath}/css/component/weather.css" /> </stripes:layout-component> <stripes:layout-component name="js"> <script type="text/javascript" src="${contextPath}/js/component/weather.js"></script> </stripes:layout-component> </stripes:layout-render> And you're weather.jsp should look like this: <stripes:layout-definition> <div class="weather"> <h1>Weather</h1> <div>Blah Blah Blah</div> </div> <stripes:layout-definition> kind regards, Karen On 18-06-10 17:01, Thiago Caiubi wrote: > Hi, > > Let's say I have a weather component and I wanna use it in a web page. This > component has html markup, javascript behaviour and css style, and it is in a > single JSP inside a<stripes:layout-definition />. > So I call the weather component in a page like this:<stripes:layout-render > name="/component/weather.jsp" />. This web page where I call the component > also uses the whole application template. > > I will write an example to simplify the case... > > Main template (main.jsp): > > <stripes:layout-definition> > <html> > <head> > <stripes:layout-component name="css" /> > </head> > <body> > <stripes:layout-component name="header"> > <div>HEADER</div> > <stripes:layout-component> > > <stripes:layout-component name="content"> > <div>CONTENT</div> > <stripes:layout-component> > > <stripes:layout-component name="footer"> > <div>FOOTER</div> > <stripes:layout-component> > > <stripes:layout-component name="js" /> > </body> > </html> > </stripes:layout-definition> > > Some web page: > > <stripes:layout-render name="/template/main.jsp"> > <stripes:layout-component name="content"> > <stripes:layout-render name="/component/weather.jsp" /> > </stripes:layout-component> > </stripes:layout-render> > > Weather component (weather.jsp): > > <stripes:layout-definition> > <stripes:layout-component name="css"> > <link rel="stylesheet" type="text/css" > href="${contextPath}/css/component/weather.css" /> > </stripes:layout-component> > > <stripes:layout-component name="js"> > <script type="text/javascript" > src="${contextPath}/js/component/weather.js"></script> > </stripes:layout-component> > > <div class="weather"> > <h1>Weather</h1> > <div>Blah Blah Blah</div> > </div> > <stripes:layout-definition> > > Till now everything OK, stripes rocks!!! lol > > My need comes here, I want the stylesheet and javascript to be put into > layout component of the main template! > CSS inside<head /> and and JS at the bottom, below the footer component!! > > Example of html I would like to be rendered: > > <html> > <head> > <link rel="stylesheet" type="text/css" > href="/contextPath/css/component/weather.css" /> > </head> > <body> > <div>HEADER</div> > > <div class="weather"> > <h1>Weather</h1> > <div>Blah Blah Blah</div> > </div> > > <div>FOOTER</div> > <script type="text/javascript" > src="/contextPath/js/component/weather.js"></script> > </body> > </html> > > Is there any way to do it? > > I am looking forward for your answer. Thanks.... > > Thiago Caiubi > thiago.cai...@gmail.com > > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo ------------------------------------------------------------------------------ ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users