aspose file tools*
The moose likes Tomcat and the fly likes Can we saperate Jsp files folder from Tomcat? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Can we saperate Jsp files folder from Tomcat?" Watch "Can we saperate Jsp files folder from Tomcat?" New topic
Author

Can we saperate Jsp files folder from Tomcat?

Shashidhar Yarabati
Ranch Hand

Joined: Jun 17, 2007
Posts: 175
Hi All!

Kindly please ignore this question by providing link, if it is already posted. Can I put my Jsp pages folder outside webapps folder in Tomcat Directory? If yes Can you please tell the solution, How to do???

Thanks in Advance.

Shashidhar Rao
SCJP1.5
[ August 01, 2007: Message edited by: Shashidhar Rao ]

Shashidhar<br /> SCJP 1.5<br /> SCWCD 5.0
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61661
    
  67

You can't put JSP pages outside of a web app, but your web app doesn't need to be under the Tomcat webapps folder either. Is that what you are asking?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

There are a couple ways to do this.
I'll describe what I do.

In, TOMCAT_INSTALL/conf/Catalina/localhost I created an context fragment file.
This file is named after my contextName + a ".xml" extension.

Example: "myApp.xml".

In the context fragment file, I point to the folder that contains my web app.


The directory must have a valid web app structure (must contain WEB-INF folder).

For more information on that attributes of the Context entry see:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
[ August 01, 2007: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Shashidhar Yarabati
Ranch Hand

Joined: Jun 17, 2007
Posts: 175
Thanks All for prompt Reply!

Let me clear my question. I have more than 100 Jsp pages in folder(say, JspFolder). And my directory structre looks like : TOMCAT_HOME/webapps/contextpath/JspFolder(and)WEB-INF/clasees(and)web.xml.
I deployed it and making use of it. Then after I want to saperate my JspFolder from that area, I don't want to see that at there. B'coz I want to change my jsp files continously...
And my questions are:
1) Is it possible to do like that?
2) If yes can I deploy it again?
3) How should I specify my jsp files in web.xml

I hope you all understand my problem???
Thanks in Advance


Shashidhar Rao
[ August 02, 2007: Message edited by: Shashidhar Rao ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61661
    
  67

Again, you cannot move your JSPs out of the document base for the web app. Why would you want to do that? You can change them wherever they are.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can we saperate Jsp files folder from Tomcat?