Re: JSP suggestion
> Sorry, but that wouldn't help the original poster. Oh, Ralph, now you've gone and spoiled the fun. I was really enjoying this thread. > He is searching for a way to include taglib definitions > and imports that are used in the pages. Any kind of dynamic > include or decorators wouldn't achieve that. Yes, of course, you are absolutely right :-) Regards Harry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE : JSP suggestion
Ralph Einfeldt said: > > Sorry, but that wouldn't help the original poster. > > He is searching for a way to include taglib definitions > and imports that are used in the pages. Any kind of dynamic > include or decorators wouldn't achieve that. Sorry, you're right, misread the original post. Had it in my mind that they wanted to insert meta tags... John Sidney-Woollett - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE : JSP suggestion
Sorry, but that wouldn't help the original poster. He is searching for a way to include taglib definitions and imports that are used in the pages. Any kind of dynamic include or decorators wouldn't achieve that. > -Original Message- > From: John Sidney-Woollett [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 24, 2004 11:09 PM > To: Hertenstein Alain > Cc: Tomcat Users List > Subject: Re: RE : JSP suggestion > > > Also have a look at OpenSymphony's SiteMesh filter - it does just what > you're trying to do with your filter explanation here. > SiteMesh is VERY > good! > > See http://www.opensymphony.com/sitemesh/ > > It looks complicated, but it's not, and you can control through an XML > file which files get filtered or not (by pattern matching URLs). > > The real power is that you build your jsp pages and focus on the core > presentation task in hand, then let the sitemesh filter > "decorate" it by > extracting your page head, body etc and inserting those > elements into a > template page (for example). > > You could have a simple template that just adds extra meta tags, or > specifies the style sheet or whatever you want. > > I've seen no downsides to using it, and speed is good too. > Couple it with > OSCache (http://www.opensymphony.com/oscache/), and you have > a couple of > blinding tools. > > Hope that helps. > > John Sidney-Woollett > > Hertenstein Alain said: > > As for Servlet 2.3 specifications, you could easily create a Servlet > > Filter which would intercept all your requests based on > your url-pattern > > (defined in web.xml), and which would do something like : > > > > RequestDispatcher reqDispatcher = > > request.getRequestDispatcher("header.jsp"); > > reqDispatcher.include(request, response); > > > > And then let the filter forward to the requested page > (chain.doFilter()). > > Thus all your pages would include your header.jsp file > (beware not to > > include header.jsp into header.jsp file, or you'll get an > infinite loop > > ;-) ) > > > > This is quite easy to implement and the best way IMHO. Have > a look at the > > http://java.sun.com web site for more info on Servlet > Filters, they are > > very handy as soon as you understand how they work. > > > > Hope this helps, > > Alain > > > > -Message d'origine- > > De : Keith Hyland [mailto:[EMAIL PROTECTED] > > Envoyé : mercredi, 24. mars 2004 16:56 > > À : Tomcat Users List > > Objet : Re: JSP suggestion > > > > > > Or you can specify a prelude.jspf file in your web.xml (I > think this may > > only work with servlet spec 2.4 servers) > > > > (The prelude is added to the top of the file, the coda is > added to the > > end of the file) > > > > > > > > > >allFiles > >*.jsp > >false > >false > >false > >/template/prelude.jspf > >/template/coda.jspf > > > > > > > > Keith > > > > Adam Buglass wrote on 24/03/2004, 14:55: > > > > > I use > > > > > > > > > > > > HTH. > > > Adam. > > > > > > > > > On Wed, 2004-03-24 at 14:46, Edson Alves Pereira wrote: > > > > Hello folks, i´d like to build a default jsp header to all my > > > > jsp´page, in this header i would put all taglibs and > imports i need, > > > but i > > in doubt about which is the best way to do it. Sould i > > make all > others page > > extends this header page or do > a <@ page > > import in every page? Any > idea? > > > > > > Regards, > > > > Edson > > > - > 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: RE : JSP suggestion
Also have a look at OpenSymphony's SiteMesh filter - it does just what you're trying to do with your filter explanation here. SiteMesh is VERY good! See http://www.opensymphony.com/sitemesh/ It looks complicated, but it's not, and you can control through an XML file which files get filtered or not (by pattern matching URLs). The real power is that you build your jsp pages and focus on the core presentation task in hand, then let the sitemesh filter "decorate" it by extracting your page head, body etc and inserting those elements into a template page (for example). You could have a simple template that just adds extra meta tags, or specifies the style sheet or whatever you want. I've seen no downsides to using it, and speed is good too. Couple it with OSCache (http://www.opensymphony.com/oscache/), and you have a couple of blinding tools. Hope that helps. John Sidney-Woollett Hertenstein Alain said: > As for Servlet 2.3 specifications, you could easily create a Servlet > Filter which would intercept all your requests based on your url-pattern > (defined in web.xml), and which would do something like : > > RequestDispatcher reqDispatcher = > request.getRequestDispatcher("header.jsp"); > reqDispatcher.include(request, response); > > And then let the filter forward to the requested page (chain.doFilter()). > Thus all your pages would include your header.jsp file (beware not to > include header.jsp into header.jsp file, or you'll get an infinite loop > ;-) ) > > This is quite easy to implement and the best way IMHO. Have a look at the > http://java.sun.com web site for more info on Servlet Filters, they are > very handy as soon as you understand how they work. > > Hope this helps, > Alain > > -Message d'origine- > De : Keith Hyland [mailto:[EMAIL PROTECTED] > Envoyé : mercredi, 24. mars 2004 16:56 > À : Tomcat Users List > Objet : Re: JSP suggestion > > > Or you can specify a prelude.jspf file in your web.xml (I think this may > only work with servlet spec 2.4 servers) > > (The prelude is added to the top of the file, the coda is added to the > end of the file) > > > > >allFiles >*.jsp >false >false >false >/template/prelude.jspf >/template/coda.jspf > > > > Keith > > Adam Buglass wrote on 24/03/2004, 14:55: > > > I use > > > > > > > > HTH. > > Adam. > > > > > > On Wed, 2004-03-24 at 14:46, Edson Alves Pereira wrote: > > > Hello folks, i´d like to build a default jsp header to all my > > > jsp´page, in this header i would put all taglibs and imports i need, > > but i > > in doubt about which is the best way to do it. Sould i > make all > others page > > extends this header page or do a <@ page > import in every page? Any > idea? > > > > > Regards, > > > Edson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE : JSP suggestion
As for Servlet 2.3 specifications, you could easily create a Servlet Filter which would intercept all your requests based on your url-pattern (defined in web.xml), and which would do something like : RequestDispatcher reqDispatcher = request.getRequestDispatcher("header.jsp"); reqDispatcher.include(request, response); And then let the filter forward to the requested page (chain.doFilter()). Thus all your pages would include your header.jsp file (beware not to include header.jsp into header.jsp file, or you'll get an infinite loop ;-) ) This is quite easy to implement and the best way IMHO. Have a look at the http://java.sun.com web site for more info on Servlet Filters, they are very handy as soon as you understand how they work. Hope this helps, Alain -Message d'origine- De : Keith Hyland [mailto:[EMAIL PROTECTED] Envoyé : mercredi, 24. mars 2004 16:56 À : Tomcat Users List Objet : Re: JSP suggestion Or you can specify a prelude.jspf file in your web.xml (I think this may only work with servlet spec 2.4 servers) (The prelude is added to the top of the file, the coda is added to the end of the file) allFiles *.jsp false false false /template/prelude.jspf /template/coda.jspf Keith Adam Buglass wrote on 24/03/2004, 14:55: > I use > > > > HTH. > Adam. > > > On Wed, 2004-03-24 at 14:46, Edson Alves Pereira wrote: > > Hello folks, i´d like to build a default jsp header to all my > > jsp´page, in this header i would put all taglibs and imports i need, > but i > > > > in doubt about which is the best way to do it. Sould i make all > others page > > > > extends this header page or do a <@ page import in every page? Any > idea? > > > > > > Regards, > > Edson ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP suggestion
It depends what you are trying to accomplish. If you are trying for common functionality at the beginning of a page - it might be better to have a custom tag at the beginnign of all your files which does the stuff you need. Otherwise (IMO) - standard imports (@file include) stink. Only import what you really need to import and declare. Its more code up front but you don't run into strange cross dependencies. Short term - they feel nice - long term they are a pain to maintain. -Tim Edson Alves Pereira wrote: Hello folks, i´d like to build a default jsp header to all my jsp´page, in this header i would put all taglibs and imports i need, but i in doubt about which is the best way to do it. Sould i make all others page extends this header page or do a <@ page import in every page? Any idea? Regards, Edson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSP suggestion
Or you can specify a prelude.jspf file in your web.xml (I think this may only work with servlet spec 2.4 servers) (The prelude is added to the top of the file, the coda is added to the end of the file) allFiles *.jsp false false false /template/prelude.jspf /template/coda.jspf Keith Adam Buglass wrote on 24/03/2004, 14:55: > I use > > > > HTH. > Adam. > > > On Wed, 2004-03-24 at 14:46, Edson Alves Pereira wrote: > > Hello folks, iÂd like to build a default jsp header to all my > > jspÂpage, in this header i would put all taglibs and imports i need, > but i > > in doubt about which is the best way to do it. Sould i make all > others page > > extends this header page or do a <@ page import in every page? Any > idea? > > > > Regards, > > Edson > > > - > 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: JSP suggestion
I use HTH. Adam. On Wed, 2004-03-24 at 14:46, Edson Alves Pereira wrote: > Hello folks, iÂd like to build a default jsp header to all my > jspÂpage, in this header i would put all taglibs and imports i need, but i > in doubt about which is the best way to do it. Sould i make all others page > extends this header page or do a <@ page import in every page? Any idea? > > Regards, > Edson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]