How can I set things up such that some of my code is run upon starting of all of my JSPs? If possible, can I share what is started with the generated servlets?

Maxim Senin

You can create an alias for your JSPs so that a servlet will be called which later will forward/include your JSPs into its body after doing the pre-processing you need. For example, define an alias
/jsp/ = com.mycompany.myPreprocessingServlet
everything after /jsp/ prefix will be considered file name, so for
/jsp/myJspPage.jsp
servlet will get requestURI=myServletPage.jsp. Its servlet's job to forward request to right path and compute real path with servletContext.getRealPath().

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact