It is not bad to have a lot of JSPs. During translation time every JSP is converted to a servlet. This servlet is then loaded into memory and instantiated when requested. Only one servlet instance will be loaded per servlet(jsp) on the Container unless you are implementing the SingleThreadModel. Hope this helps. Cheers, Ryan
SCJP 1.4, SCWCD
Java: The power, elegance, and simplicity of a hand grenade
Suppose I access all the pages of a web app then many servlet instances(= # of JSP's) are created. If I use jsp:include tags in my pages there will be more jsps which means more servlet instances. Does it mean to say that avoiding jsp:include (by replacing jsp:include tag by the code of the pages refered by jsp:include )is better?
My opinion would be to use as many JSPs as makes sense for the structure of your application without worrying about the number. It is unlikely that the number of servlets in your app is the cause of performance problems (if any). Is this an academic exercise, or are you actually trying to track down a performance issue? bear [ May 06, 2003: Message edited by: Bear Bibeault ]
Once you create a servlet instance for a class, there will NEVER be more than one servlet instance for that particular class. That is, unless you implement the SingleThreadModel. If you are accessing X pages then there will never be more than X + 0 instances. Does this make sense? I personally follow the MVC design pattern. The only time I use a JSP page is for the presentation layer of my program. I never include business logic in a JSP. Cheers, Ryan