aspose file tools*
The moose likes JSP and the fly likes Problem with JSP Includes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Problem with JSP Includes" Watch "Problem with JSP Includes" New topic
Author

Problem with JSP Includes

kartik krishnan
Ranch Hand

Joined: Nov 19, 2006
Posts: 63
I have a JSP file which includes a lot of JSPs for purposes of modularity. But I am having to include the taglibs and javascript files that we use in every JSP file that has been included. That way , I am import files in every JSP file. I wanted to know if there is a way to import all of these files in one location and make them available to all the JSPS
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61419
    
  67

Originally posted by kartik krishnanand:
I have a JSP file which includes a lot of JSPs for purposes of modularity.


If you are using JSP 2.0, tag files would be a better mechanism for this purpose.

But I am having to include the taglibs and javascript files that we use in every JSP file that has been included. That way , I am import files in every JSP file.


If you are worried that this is going to cause any sort of a performance issue, rest easy. The "import" is a translation-time artifact and will not affect run-time performance.

However, it is a pain in the neck, as well as error-prone, to copy the declarations on each and every page. You may want to explore the concept of a JSP prelude.

More information can be found in the JSP Specification.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with JSP Includes