Web tier: servlets, JSP, Web frameworks: For implementing the common logic in jsps
- Posted by: balaji jayaram
- Posted on: February 09 2006 02:30 EST
For implementing a the common logic in all the jsps in a web application.
Is there anyway to specify in jsps to extend from some common servlet/javax.servlet.jsp.HttpJspPage.
Any info regarding the same will be of grate help.
You can write the common logic in functions in one or more .js files and then include the .js files in rest of your JSPs
You may want to look at using something like the Tiles mechanism that is part of the Struts framework.
(There are other alternatives but, as I'm not familiar with them, I'll leave the description these to somebody else)
Whether is based purely on JSP files or a combination of servlets and JSPs, you'll gain a great deal of re-use from adding Tiles support.
There are lots of tutorials on the web, a notable example being a sample chapter from a Ted Husted (Very active figure on this subject) book. http://www.manning-source.com/books/husted/husted_ch11.pdf
Give it try - I'm sure you'll like it.