Re: Common header and footer html
G'day, This is probably the suck, but: template.jsp: <[EMAIL PROTECTED] prefix="s" uri="/struts-tags" %> <[EMAIL PROTECTED] import='com.opensymphony.xwork2.ActionContext' %> Some header stuf <%! String actionname=(String)ActionContext.getContext().get(ActionContext.ACTION_NAME); %> "/> Footer stuff With a default action that looks like: template.jsp Now, you've gotta do a bit more in the template JSP to deal with actions like foo_input... But that's kinda the idea... PK Ståle Undheim wrote: Currently, all my jsp pages are structured like this: * identical html header and tag ... * page specific content * identical trail of and Instead of copying this for every file, I would like to have 1 common outer wrapper file, that includes a jsp based on the action or something. I have been looking at the tiles plugin, but I couldn't make out enough from the documentation to see how I could use it. My ideal solution would be something like having a layout.jsp that looks like this: <% include jsp based on ActionName or an annotation, or that I can set with an interceptor of sorts. %> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Common header and footer html
--- meeboo <[EMAIL PROTECTED]> wrote: > Is there a good way of achieving this in Struts 2 > without using Tiles? > I'm new to Struts and coming from a Tapestry > background my first hunch was to create classes for a > header and a footer element, but is this even a > viable option in an action based framework? Well, S2 is definitely not a component-based framework. That said, if you're dead-set on not using Tiles or Sitemesh you could create actions that rendered the header and footer and use tags or equivalent or use (or even <%@ include...> or whatever the static include is) and just put those tags on every page. There are probably several other solutions that people will chime in with as well. d. Finding fabulous fares is fun. Let Yahoo! FareChase search your favorite travel sites to find flight and hotel bargains. http://farechase.yahoo.com/promo-generic-14795097 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Common header and footer html
To solve the problem of headers, footer, layouts accross a web site i use sitemesh. I have several layouts, one two and three columns layouts...I applied this layouts to my pages... I think its a good solution to your problem... Here is the url http://www.opensymphony.com/sitemesh/ Regards Juan -Mensaje original- De: meeboo [mailto:[EMAIL PROTECTED] Enviado el: viernes, 30 de marzo de 2007 11:09 Para: user@struts.apache.org Asunto: RE: Common header and footer html Is there a good way of achieving this in Struts 2 without using Tiles? I'm new to Struts and coming from a Tapestry background my first hunch was to create classes for a header and a footer element, but is this even a viable option in an action based framework? If not, what's the best practice when you're faced with implementing such a thing? Cheers Raghupathy, Gurumoorthy wrote: > > http://struts.apache.org/1.x/struts-tiles/ is your answer > > Regards > Guru > > > -Original Message- > From: Ståle Undheim [mailto:[EMAIL PROTECTED] > Sent: 30 March 2007 13:55 > To: user@struts.apache.org > Subject: Common header and footer html > > Currently, all my jsp pages are structured like this: > * identical html header and tag ... > * page specific content > * identical trail of and > > Instead of copying this for every file, I would like to have 1 common > outer wrapper file, that includes a jsp based on the action or > something. > > I have been looking at the tiles plugin, but I couldn't make out > enough from the documentation to see how I could use it. > > My ideal solution would be something like having a layout.jsp that > looks like this: > > > > > <% include jsp based on ActionName or an annotation, or that I can set > with an interceptor of sorts. %> > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Common-header-and-footer-html-tf3492025.html#a9753895 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.22/739 - Release Date: 29/03/2007 13:36 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.22/739 - Release Date: 29/03/2007 13:36 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Common header and footer html
Is there a good way of achieving this in Struts 2 without using Tiles? I'm new to Struts and coming from a Tapestry background my first hunch was to create classes for a header and a footer element, but is this even a viable option in an action based framework? If not, what's the best practice when you're faced with implementing such a thing? Cheers Raghupathy, Gurumoorthy wrote: > > http://struts.apache.org/1.x/struts-tiles/ is your answer > > Regards > Guru > > > -Original Message- > From: Ståle Undheim [mailto:[EMAIL PROTECTED] > Sent: 30 March 2007 13:55 > To: user@struts.apache.org > Subject: Common header and footer html > > Currently, all my jsp pages are structured like this: > * identical html header and tag ... > * page specific content > * identical trail of and > > Instead of copying this for every file, I would like to have 1 common > outer wrapper file, that includes a jsp based on the action or > something. > > I have been looking at the tiles plugin, but I couldn't make out > enough from the documentation to see how I could use it. > > My ideal solution would be something like having a layout.jsp that > looks like this: > > > > > <% include jsp based on ActionName or an annotation, or that I can set > with an interceptor of sorts. %> > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Common-header-and-footer-html-tf3492025.html#a9753895 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Common header and footer html
--- Ståle Undheim <[EMAIL PROTECTED]> wrote: > I have been looking at the tiles plugin, but I > couldn't make out enough from the documentation to > see how I could use it. A combination of the plugin docs and older Tiles docs should be enough to get you going. http://struts.apache.org/2.x/docs/tiles-plugin.html http://struts.apache.org/1.x/struts-tiles/ >From a configuration perspective, particularly for simple use-cases, it's largely an issue of config and tag attribute name changes. d. TV dinner still cooling? Check out "Tonight's Picks" on Yahoo! TV. http://tv.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Common header and footer html
http://struts.apache.org/1.x/struts-tiles/ is your answer Regards Guru -Original Message- From: Ståle Undheim [mailto:[EMAIL PROTECTED] Sent: 30 March 2007 13:55 To: user@struts.apache.org Subject: Common header and footer html Currently, all my jsp pages are structured like this: * identical html header and tag ... * page specific content * identical trail of and Instead of copying this for every file, I would like to have 1 common outer wrapper file, that includes a jsp based on the action or something. I have been looking at the tiles plugin, but I couldn't make out enough from the documentation to see how I could use it. My ideal solution would be something like having a layout.jsp that looks like this: <% include jsp based on ActionName or an annotation, or that I can set with an interceptor of sorts. %> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]