You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Victor Huang <vi...@gameworkz.com> on 2007/06/26 16:14:55 UTC

Can Tomcat access JSP pages out of tomcat folder?

Hi There,

 

 

 

I'm working on a project that needs to move current web application from
IIS/JRUN/Windows into Apache/Tomcat/Windows. One of the problem is I can not
make Tomcat access (pre-compile) JSP pages deployed out of Tomcat folder. It
is working fine under IIS/JRUN. 

 

 

 

Our current application has 3 parts:

 

 

1. web application back-end which is a WAR file deployed under JRUN

 

2. web application front-end which is a set of JSPs, htmls, image files,
javascripts, etc. deployed under IIS.

 

3. A set of JSPs, JavaScript files which can be accessed by front-end. 

 

 

 

In case of IIS for example I have index.jsp under IIS which includes
login.jsp which located under another directory - c:\comp\inc\login.jsp,
when IIS calls index.jsp it redirects the page to JRUN, JRUN will complete
the rest of the work and return result to IIS. But this doesn't work on
Apache/Tomcat unless I put all files under Tomcat's webapps directory. Every
time I call Index.jsp all I get in browser is full of html/jsp code in that
file (on FF) or static contents with jsp code (on IE). It seems to me Apache
/jk connector doesn't send the page to Tomcat but rather serve it as a
static HTML page!

 

 

I tried to change server.xml by adding Context, JK connector properties
file, Apache httpd.conf by adding lines which specifies external resource
but it didn't work out.

 

 

Can anyone help me out? Thanks in advance!

 

 

 

/Victor

 

 


RE: Can Tomcat access JSP pages out of tomcat folder?

Posted by Victor Huang <vi...@gameworkz.com>.
Ok. Thanks!

Victor Huang| Senior Developer | GameWorkz Inc.  

 

-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Tuesday, June 26, 2007 2:38 PM
To: Tomcat Users List
Subject: RE: Can Tomcat access JSP pages out of tomcat folder?

> From: Victor Huang [mailto:victorh@gameworkz.com] 
> Subject: RE: Can Tomcat access JSP pages out of tomcat folder?
> 
> One more question - Can I have a blank web.xml under
> C:\myapp-share\jsps\WEB-INF? Or do I need to put something there?

See my previous message; with Tomcat, you don't need it at all.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org





---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Can Tomcat access JSP pages out of tomcat folder?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Victor Huang [mailto:victorh@gameworkz.com] 
> Subject: RE: Can Tomcat access JSP pages out of tomcat folder?
> 
> One more question - Can I have a blank web.xml under
> C:\myapp-share\jsps\WEB-INF? Or do I need to put something there?

See my previous message; with Tomcat, you don't need it at all.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Can Tomcat access JSP pages out of tomcat folder?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: David Smith [mailto:dns4@cornell.edu] 
> Subject: Re: Can Tomcat access JSP pages out of tomcat folder?
> 
> That can work, but your C:\myapp-share\jsps directory will need a 
> WEB-INF folder and WEB-INF/web.xml per the servlet spec.

Actually, with Tomcat, you don't need those for simple webapps.  Other
containers might well require them, however.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Can Tomcat access JSP pages out of tomcat folder?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Victor Huang [mailto:victorh@gameworkz.com] 
> Subject: RE: Can Tomcat access JSP pages out of tomcat folder?
> 
> <Context path="/" docBase="C:/www/myapp" crossContext="true"/>
> <Context path="/bs" docBase="C:/shared-jsp/component" 
> crossContext="true"/>

As stated before, remove the path attribute - it's not allowed unless
the <Context> element is in server.xml, which no one should be doing
anymore.  If you want a particular webapp to be the default webapp, its
name must be ROOT (upper case required).  The URI path for the webapp is
derived from the name of its .xml file when that is stored in the
conf/Catalina/[host] directory.

> <jsp:include page="/bs/components/test2.jsp">

Can test2.jsp be accessed directly via an HTTP invocation?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Can Tomcat access JSP pages out of tomcat folder?

Posted by Victor Huang <vi...@gameworkz.com>.
Hi Chuck,

I'm able to call jsps out of Tomcat following the instruction given. Thanks!


However, I now have another problem - see I have set two Contexts in tomcat
called: Context1, Context2. I even setup crossContext to "true"

<Context path="/" docBase="C:/www/myapp" crossContext="true"/>

<Context path="/bs" docBase="C:/shared-jsp/component" crossContext="true"/>


Test1.jsp and Test3.jsp is under Context1

Test2.jsp is under Context2

Test2.jsp and Test3.jsp are included in Test1.jsp

Here is the snippet of test1.jsp:

<jsp:include page="/bs/components/test2.jsp">
<jsp:param name="successpage" value="sucess.jsp" />        
<jsp:param name="errorpage" value="error.jsp" />        
<jsp:param name="submitbutton" value="images/button_index_submit.gif" />

</jsp:include>   
<tr>
        <td align="center" valign="top">
		<br />
		<jsp:include page="inc/test3.jsp" flush="true" />
		<br />

		</td>
      </tr>



For some reason, the jsp:include for test2.jsp doesn't work but test3.jsp
works. I suspect that it doesn't allow cross-context access so I set it to
"true" but still not working.

Any/all comments, help are appreciated!

Thanks in advance!

/Victor

 

-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Tuesday, June 26, 2007 4:35 PM
To: Tomcat Users List
Subject: RE: Can Tomcat access JSP pages out of tomcat folder?

> From: Victor Huang [mailto:victorh@gameworkz.com] 
> Subject: RE: Can Tomcat access JSP pages out of tomcat folder?
> 
> But I noticed that you were using $Tomcat_home directory as 
> docBase.

No - that directory is completely outside of where Tomcat's installed,
which is C:\apache-tomcat-6.0.13.  The test webapp is in
C:\apache-tomcat-webapps.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org





---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Can Tomcat access JSP pages out of tomcat folder?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Victor Huang [mailto:victorh@gameworkz.com] 
> Subject: RE: Can Tomcat access JSP pages out of tomcat folder?
> 
> But I noticed that you were using $Tomcat_home directory as 
> docBase.

No - that directory is completely outside of where Tomcat's installed,
which is C:\apache-tomcat-6.0.13.  The test webapp is in
C:\apache-tomcat-webapps.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Can Tomcat access JSP pages out of tomcat folder?

Posted by Victor Huang <vi...@gameworkz.com>.

Thanks, Chuck.

But I noticed that you were using $Tomcat_home directory as docBase. That's
different with my configuration - I wanted to load this web app which is out
of $tomcat_home directory. 

Yes, it would work if I put web app into $Tomcat_home. 

/Victor

 

-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Tuesday, June 26, 2007 3:59 PM
To: Tomcat Users List
Subject: RE: Can Tomcat access JSP pages out of tomcat folder?

> From: Victor Huang [mailto:victorh@gameworkz.com] 
> Subject: RE: Can Tomcat access JSP pages out of tomcat folder?
> 
> I followed what you suggested - create WEB-INF folder under
> C:\myapp-shares\jsps, create bs.xml under
> $tomcat_home/conf/Catalina/localhost
> 
> <Context path="/bs" 
> docbase="C:\\myapp-share\\jsps" />

The path attribute is not allowed - it's defined by the name of the .xml
file.  Also, you might try using a single forward slash rather than the
double backslashes.  I'm using the following without problems for simple
tests:

<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="C:/apache-tomcat-webapps/test"/>

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org





---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Can Tomcat access JSP pages out of tomcat folder?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Victor Huang [mailto:victorh@gameworkz.com] 
> Subject: RE: Can Tomcat access JSP pages out of tomcat folder?
> 
> I followed what you suggested - create WEB-INF folder under
> C:\myapp-shares\jsps, create bs.xml under
> $tomcat_home/conf/Catalina/localhost
> 
> <Context path="/bs" 
> docbase="C:\\myapp-share\\jsps" />

The path attribute is not allowed - it's defined by the name of the .xml
file.  Also, you might try using a single forward slash rather than the
double backslashes.  I'm using the following without problems for simple
tests:

<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="C:/apache-tomcat-webapps/test"/>

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Can Tomcat access JSP pages out of tomcat folder?

Posted by Victor Huang <vi...@gameworkz.com>.
Hello David,

I followed what you suggested - create WEB-INF folder under
C:\myapp-shares\jsps, create bs.xml under
$tomcat_home/conf/Catalina/localhost

<Context path="/bs" 
docbase="C:\\myapp-share\\jsps" />

But when Tomcat startup, I got exception below -

SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base C:\Program Files\Apache
Software Foundation\Tomcat 5.5\webapps\bs does not exist or is not a
readable directory
	at
org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:14
1)
	at
org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java
:3855)
	at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4024)
	at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:7
60)
	at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
	at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
	at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
	at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553
)
	at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
	at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
	at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
	at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:120)
	at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
	at
org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
	at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
	at org.apache.c


It seemed to me that Tomcat doesn't recognize the absolute pathname for
docBase I specified in the xml file. it still tries to pull out resources
from $Tomcat_home\webapps\* 

Did I miss anything here?

Thanks,
Victor
 

-----Original Message-----
From: David Smith [mailto:dns4@cornell.edu] 
Sent: Tuesday, June 26, 2007 1:59 PM
To: Tomcat Users List
Subject: Re: Can Tomcat access JSP pages out of tomcat folder?

That can work, but your C:\myapp-share\jsps directory will need a 
WEB-INF folder and WEB-INF/web.xml per the servlet spec.  Then you'll 
have to write a file named jsps.xml with the <Context path="/htmlPath" 
docbase="C:\\myapp-share\\jsps" /> element in it and place that within 
conf/Catalina/localhost of your tomcat app.  Given you aren't putting 
the webapp in the tomcat webapps directory, you can declare the path 
attribute to be any path that fits into your site design.

At the end of it all, any collection of jsps has to be put together in a 
valid web application as defined by the servlet spec before it can be 
served up by tomcat.  Then you can mount the jsps webapp in Apache Httpd 
using mod_jk and the JkMount directive.

The documentation on the tomcat website is your friend here.

--David

Victor Huang wrote:
> Thanks David.
> I'm using Tomcat 5.5.23 and Apache 2.2.4, JK-1.2.22 on Windows XP
>
> I understand that I can put JSPs into TOMCAT-INSTALL\webapps\* (I tried it
> and it worked) but that doesn't solve my issue. I wanted to put JSPs into
> somewhere out of Tomcat completely - lets say C:\myapp-share\jsps\. Make a
> link/virtual folder for that directory in Apache, when Apache gets the
> request page from that folder it will pass into Tomcat container or Tomcat
> can look for it through file system based on what Apache/JK passes in. Is
> that do-able?
>
>
> Regards,
> Victor
>
>  
>
> -----Original Message-----
> From: David Smith [mailto:dns4@cornell.edu] 
> Sent: Tuesday, June 26, 2007 11:44 AM
> To: Tomcat Users List
> Subject: Re: Can Tomcat access JSP pages out of tomcat folder?
>
> They can be accessed outside of tomcat's folder, but still have to be in 
> a webapp structure per spec.  Can you describe your layout a bit more 
> and include the version of your tomcat?
>
> --David
>
> Victor Huang wrote:
>   
>> Hi There,
>>
>>  
>>
>>  
>>
>>  
>>
>> I'm working on a project that needs to move current web application from
>> IIS/JRUN/Windows into Apache/Tomcat/Windows. One of the problem is I can
>>     
> not
>   
>> make Tomcat access (pre-compile) JSP pages deployed out of Tomcat folder.
>>     
> It
>   
>> is working fine under IIS/JRUN. 
>>
>>  
>>
>>  
>>
>>  
>>
>> Our current application has 3 parts:
>>
>>  
>>
>>  
>>
>> 1. web application back-end which is a WAR file deployed under JRUN
>>
>>  
>>
>> 2. web application front-end which is a set of JSPs, htmls, image files,
>> javascripts, etc. deployed under IIS.
>>
>>  
>>
>> 3. A set of JSPs, JavaScript files which can be accessed by front-end. 
>>
>>  
>>
>>  
>>
>>  
>>
>> In case of IIS for example I have index.jsp under IIS which includes
>> login.jsp which located under another directory - c:\comp\inc\login.jsp,
>> when IIS calls index.jsp it redirects the page to JRUN, JRUN will
complete
>> the rest of the work and return result to IIS. But this doesn't work on
>> Apache/Tomcat unless I put all files under Tomcat's webapps directory.
>>     
> Every
>   
>> time I call Index.jsp all I get in browser is full of html/jsp code in
>>     
> that
>   
>> file (on FF) or static contents with jsp code (on IE). It seems to me
>>     
> Apache
>   
>> /jk connector doesn't send the page to Tomcat but rather serve it as a
>> static HTML page!
>>
>>  
>>
>>  
>>
>> I tried to change server.xml by adding Context, JK connector properties
>> file, Apache httpd.conf by adding lines which specifies external resource
>> but it didn't work out.
>>
>>  
>>
>>  
>>
>> Can anyone help me out? Thanks in advance!
>>
>>  
>>
>>  
>>
>>  
>>
>> /Victor
>>
>>  
>>
>>  
>>
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org





---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Can Tomcat access JSP pages out of tomcat folder?

Posted by Victor Huang <vi...@gameworkz.com>.
Thanks for the help. I'll try it out.

/Victor

 

-----Original Message-----
From: David Smith [mailto:dns4@cornell.edu] 
Sent: Tuesday, June 26, 2007 1:59 PM
To: Tomcat Users List
Subject: Re: Can Tomcat access JSP pages out of tomcat folder?

That can work, but your C:\myapp-share\jsps directory will need a 
WEB-INF folder and WEB-INF/web.xml per the servlet spec.  Then you'll 
have to write a file named jsps.xml with the <Context path="/htmlPath" 
docbase="C:\\myapp-share\\jsps" /> element in it and place that within 
conf/Catalina/localhost of your tomcat app.  Given you aren't putting 
the webapp in the tomcat webapps directory, you can declare the path 
attribute to be any path that fits into your site design.

At the end of it all, any collection of jsps has to be put together in a 
valid web application as defined by the servlet spec before it can be 
served up by tomcat.  Then you can mount the jsps webapp in Apache Httpd 
using mod_jk and the JkMount directive.

The documentation on the tomcat website is your friend here.

--David

Victor Huang wrote:
> Thanks David.
> I'm using Tomcat 5.5.23 and Apache 2.2.4, JK-1.2.22 on Windows XP
>
> I understand that I can put JSPs into TOMCAT-INSTALL\webapps\* (I tried it
> and it worked) but that doesn't solve my issue. I wanted to put JSPs into
> somewhere out of Tomcat completely - lets say C:\myapp-share\jsps\. Make a
> link/virtual folder for that directory in Apache, when Apache gets the
> request page from that folder it will pass into Tomcat container or Tomcat
> can look for it through file system based on what Apache/JK passes in. Is
> that do-able?
>
>
> Regards,
> Victor
>
>  
>
> -----Original Message-----
> From: David Smith [mailto:dns4@cornell.edu] 
> Sent: Tuesday, June 26, 2007 11:44 AM
> To: Tomcat Users List
> Subject: Re: Can Tomcat access JSP pages out of tomcat folder?
>
> They can be accessed outside of tomcat's folder, but still have to be in 
> a webapp structure per spec.  Can you describe your layout a bit more 
> and include the version of your tomcat?
>
> --David
>
> Victor Huang wrote:
>   
>> Hi There,
>>
>>  
>>
>>  
>>
>>  
>>
>> I'm working on a project that needs to move current web application from
>> IIS/JRUN/Windows into Apache/Tomcat/Windows. One of the problem is I can
>>     
> not
>   
>> make Tomcat access (pre-compile) JSP pages deployed out of Tomcat folder.
>>     
> It
>   
>> is working fine under IIS/JRUN. 
>>
>>  
>>
>>  
>>
>>  
>>
>> Our current application has 3 parts:
>>
>>  
>>
>>  
>>
>> 1. web application back-end which is a WAR file deployed under JRUN
>>
>>  
>>
>> 2. web application front-end which is a set of JSPs, htmls, image files,
>> javascripts, etc. deployed under IIS.
>>
>>  
>>
>> 3. A set of JSPs, JavaScript files which can be accessed by front-end. 
>>
>>  
>>
>>  
>>
>>  
>>
>> In case of IIS for example I have index.jsp under IIS which includes
>> login.jsp which located under another directory - c:\comp\inc\login.jsp,
>> when IIS calls index.jsp it redirects the page to JRUN, JRUN will
complete
>> the rest of the work and return result to IIS. But this doesn't work on
>> Apache/Tomcat unless I put all files under Tomcat's webapps directory.
>>     
> Every
>   
>> time I call Index.jsp all I get in browser is full of html/jsp code in
>>     
> that
>   
>> file (on FF) or static contents with jsp code (on IE). It seems to me
>>     
> Apache
>   
>> /jk connector doesn't send the page to Tomcat but rather serve it as a
>> static HTML page!
>>
>>  
>>
>>  
>>
>> I tried to change server.xml by adding Context, JK connector properties
>> file, Apache httpd.conf by adding lines which specifies external resource
>> but it didn't work out.
>>
>>  
>>
>>  
>>
>> Can anyone help me out? Thanks in advance!
>>
>>  
>>
>>  
>>
>>  
>>
>> /Victor
>>
>>  
>>
>>  
>>
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org





---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Can Tomcat access JSP pages out of tomcat folder?

Posted by Victor Huang <vi...@gameworkz.com>.
One more question - Can I have a blank web.xml under
C:\myapp-share\jsps\WEB-INF? Or do I need to put something there?

Thanks,
Victor


 

-----Original Message-----
From: David Smith [mailto:dns4@cornell.edu] 
Sent: Tuesday, June 26, 2007 1:59 PM
To: Tomcat Users List
Subject: Re: Can Tomcat access JSP pages out of tomcat folder?

That can work, but your C:\myapp-share\jsps directory will need a 
WEB-INF folder and WEB-INF/web.xml per the servlet spec.  Then you'll 
have to write a file named jsps.xml with the <Context path="/htmlPath" 
docbase="C:\\myapp-share\\jsps" /> element in it and place that within 
conf/Catalina/localhost of your tomcat app.  Given you aren't putting 
the webapp in the tomcat webapps directory, you can declare the path 
attribute to be any path that fits into your site design.

At the end of it all, any collection of jsps has to be put together in a 
valid web application as defined by the servlet spec before it can be 
served up by tomcat.  Then you can mount the jsps webapp in Apache Httpd 
using mod_jk and the JkMount directive.

The documentation on the tomcat website is your friend here.

--David

Victor Huang wrote:
> Thanks David.
> I'm using Tomcat 5.5.23 and Apache 2.2.4, JK-1.2.22 on Windows XP
>
> I understand that I can put JSPs into TOMCAT-INSTALL\webapps\* (I tried it
> and it worked) but that doesn't solve my issue. I wanted to put JSPs into
> somewhere out of Tomcat completely - lets say C:\myapp-share\jsps\. Make a
> link/virtual folder for that directory in Apache, when Apache gets the
> request page from that folder it will pass into Tomcat container or Tomcat
> can look for it through file system based on what Apache/JK passes in. Is
> that do-able?
>
>
> Regards,
> Victor
>
>  
>
> -----Original Message-----
> From: David Smith [mailto:dns4@cornell.edu] 
> Sent: Tuesday, June 26, 2007 11:44 AM
> To: Tomcat Users List
> Subject: Re: Can Tomcat access JSP pages out of tomcat folder?
>
> They can be accessed outside of tomcat's folder, but still have to be in 
> a webapp structure per spec.  Can you describe your layout a bit more 
> and include the version of your tomcat?
>
> --David
>
> Victor Huang wrote:
>   
>> Hi There,
>>
>>  
>>
>>  
>>
>>  
>>
>> I'm working on a project that needs to move current web application from
>> IIS/JRUN/Windows into Apache/Tomcat/Windows. One of the problem is I can
>>     
> not
>   
>> make Tomcat access (pre-compile) JSP pages deployed out of Tomcat folder.
>>     
> It
>   
>> is working fine under IIS/JRUN. 
>>
>>  
>>
>>  
>>
>>  
>>
>> Our current application has 3 parts:
>>
>>  
>>
>>  
>>
>> 1. web application back-end which is a WAR file deployed under JRUN
>>
>>  
>>
>> 2. web application front-end which is a set of JSPs, htmls, image files,
>> javascripts, etc. deployed under IIS.
>>
>>  
>>
>> 3. A set of JSPs, JavaScript files which can be accessed by front-end. 
>>
>>  
>>
>>  
>>
>>  
>>
>> In case of IIS for example I have index.jsp under IIS which includes
>> login.jsp which located under another directory - c:\comp\inc\login.jsp,
>> when IIS calls index.jsp it redirects the page to JRUN, JRUN will
complete
>> the rest of the work and return result to IIS. But this doesn't work on
>> Apache/Tomcat unless I put all files under Tomcat's webapps directory.
>>     
> Every
>   
>> time I call Index.jsp all I get in browser is full of html/jsp code in
>>     
> that
>   
>> file (on FF) or static contents with jsp code (on IE). It seems to me
>>     
> Apache
>   
>> /jk connector doesn't send the page to Tomcat but rather serve it as a
>> static HTML page!
>>
>>  
>>
>>  
>>
>> I tried to change server.xml by adding Context, JK connector properties
>> file, Apache httpd.conf by adding lines which specifies external resource
>> but it didn't work out.
>>
>>  
>>
>>  
>>
>> Can anyone help me out? Thanks in advance!
>>
>>  
>>
>>  
>>
>>  
>>
>> /Victor
>>
>>  
>>
>>  
>>
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org





---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Can Tomcat access JSP pages out of tomcat folder?

Posted by David Smith <dn...@cornell.edu>.
That can work, but your C:\myapp-share\jsps directory will need a 
WEB-INF folder and WEB-INF/web.xml per the servlet spec.  Then you'll 
have to write a file named jsps.xml with the <Context path="/htmlPath" 
docbase="C:\\myapp-share\\jsps" /> element in it and place that within 
conf/Catalina/localhost of your tomcat app.  Given you aren't putting 
the webapp in the tomcat webapps directory, you can declare the path 
attribute to be any path that fits into your site design.

At the end of it all, any collection of jsps has to be put together in a 
valid web application as defined by the servlet spec before it can be 
served up by tomcat.  Then you can mount the jsps webapp in Apache Httpd 
using mod_jk and the JkMount directive.

The documentation on the tomcat website is your friend here.

--David

Victor Huang wrote:
> Thanks David.
> I'm using Tomcat 5.5.23 and Apache 2.2.4, JK-1.2.22 on Windows XP
>
> I understand that I can put JSPs into TOMCAT-INSTALL\webapps\* (I tried it
> and it worked) but that doesn't solve my issue. I wanted to put JSPs into
> somewhere out of Tomcat completely - lets say C:\myapp-share\jsps\. Make a
> link/virtual folder for that directory in Apache, when Apache gets the
> request page from that folder it will pass into Tomcat container or Tomcat
> can look for it through file system based on what Apache/JK passes in. Is
> that do-able?
>
>
> Regards,
> Victor
>
>  
>
> -----Original Message-----
> From: David Smith [mailto:dns4@cornell.edu] 
> Sent: Tuesday, June 26, 2007 11:44 AM
> To: Tomcat Users List
> Subject: Re: Can Tomcat access JSP pages out of tomcat folder?
>
> They can be accessed outside of tomcat's folder, but still have to be in 
> a webapp structure per spec.  Can you describe your layout a bit more 
> and include the version of your tomcat?
>
> --David
>
> Victor Huang wrote:
>   
>> Hi There,
>>
>>  
>>
>>  
>>
>>  
>>
>> I'm working on a project that needs to move current web application from
>> IIS/JRUN/Windows into Apache/Tomcat/Windows. One of the problem is I can
>>     
> not
>   
>> make Tomcat access (pre-compile) JSP pages deployed out of Tomcat folder.
>>     
> It
>   
>> is working fine under IIS/JRUN. 
>>
>>  
>>
>>  
>>
>>  
>>
>> Our current application has 3 parts:
>>
>>  
>>
>>  
>>
>> 1. web application back-end which is a WAR file deployed under JRUN
>>
>>  
>>
>> 2. web application front-end which is a set of JSPs, htmls, image files,
>> javascripts, etc. deployed under IIS.
>>
>>  
>>
>> 3. A set of JSPs, JavaScript files which can be accessed by front-end. 
>>
>>  
>>
>>  
>>
>>  
>>
>> In case of IIS for example I have index.jsp under IIS which includes
>> login.jsp which located under another directory - c:\comp\inc\login.jsp,
>> when IIS calls index.jsp it redirects the page to JRUN, JRUN will complete
>> the rest of the work and return result to IIS. But this doesn't work on
>> Apache/Tomcat unless I put all files under Tomcat's webapps directory.
>>     
> Every
>   
>> time I call Index.jsp all I get in browser is full of html/jsp code in
>>     
> that
>   
>> file (on FF) or static contents with jsp code (on IE). It seems to me
>>     
> Apache
>   
>> /jk connector doesn't send the page to Tomcat but rather serve it as a
>> static HTML page!
>>
>>  
>>
>>  
>>
>> I tried to change server.xml by adding Context, JK connector properties
>> file, Apache httpd.conf by adding lines which specifies external resource
>> but it didn't work out.
>>
>>  
>>
>>  
>>
>> Can anyone help me out? Thanks in advance!
>>
>>  
>>
>>  
>>
>>  
>>
>> /Victor
>>
>>  
>>
>>  
>>
>>
>>   
>>     
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Can Tomcat access JSP pages out of tomcat folder?

Posted by Victor Huang <vi...@gameworkz.com>.
Thanks David.
I'm using Tomcat 5.5.23 and Apache 2.2.4, JK-1.2.22 on Windows XP

I understand that I can put JSPs into TOMCAT-INSTALL\webapps\* (I tried it
and it worked) but that doesn't solve my issue. I wanted to put JSPs into
somewhere out of Tomcat completely - lets say C:\myapp-share\jsps\. Make a
link/virtual folder for that directory in Apache, when Apache gets the
request page from that folder it will pass into Tomcat container or Tomcat
can look for it through file system based on what Apache/JK passes in. Is
that do-able?


Regards,
Victor

 

-----Original Message-----
From: David Smith [mailto:dns4@cornell.edu] 
Sent: Tuesday, June 26, 2007 11:44 AM
To: Tomcat Users List
Subject: Re: Can Tomcat access JSP pages out of tomcat folder?

They can be accessed outside of tomcat's folder, but still have to be in 
a webapp structure per spec.  Can you describe your layout a bit more 
and include the version of your tomcat?

--David

Victor Huang wrote:
> Hi There,
>
>  
>
>  
>
>  
>
> I'm working on a project that needs to move current web application from
> IIS/JRUN/Windows into Apache/Tomcat/Windows. One of the problem is I can
not
> make Tomcat access (pre-compile) JSP pages deployed out of Tomcat folder.
It
> is working fine under IIS/JRUN. 
>
>  
>
>  
>
>  
>
> Our current application has 3 parts:
>
>  
>
>  
>
> 1. web application back-end which is a WAR file deployed under JRUN
>
>  
>
> 2. web application front-end which is a set of JSPs, htmls, image files,
> javascripts, etc. deployed under IIS.
>
>  
>
> 3. A set of JSPs, JavaScript files which can be accessed by front-end. 
>
>  
>
>  
>
>  
>
> In case of IIS for example I have index.jsp under IIS which includes
> login.jsp which located under another directory - c:\comp\inc\login.jsp,
> when IIS calls index.jsp it redirects the page to JRUN, JRUN will complete
> the rest of the work and return result to IIS. But this doesn't work on
> Apache/Tomcat unless I put all files under Tomcat's webapps directory.
Every
> time I call Index.jsp all I get in browser is full of html/jsp code in
that
> file (on FF) or static contents with jsp code (on IE). It seems to me
Apache
> /jk connector doesn't send the page to Tomcat but rather serve it as a
> static HTML page!
>
>  
>
>  
>
> I tried to change server.xml by adding Context, JK connector properties
> file, Apache httpd.conf by adding lines which specifies external resource
> but it didn't work out.
>
>  
>
>  
>
> Can anyone help me out? Thanks in advance!
>
>  
>
>  
>
>  
>
> /Victor
>
>  
>
>  
>
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org





---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Can Tomcat access JSP pages out of tomcat folder?

Posted by David Smith <dn...@cornell.edu>.
They can be accessed outside of tomcat's folder, but still have to be in 
a webapp structure per spec.  Can you describe your layout a bit more 
and include the version of your tomcat?

--David

Victor Huang wrote:
> Hi There,
>
>  
>
>  
>
>  
>
> I'm working on a project that needs to move current web application from
> IIS/JRUN/Windows into Apache/Tomcat/Windows. One of the problem is I can not
> make Tomcat access (pre-compile) JSP pages deployed out of Tomcat folder. It
> is working fine under IIS/JRUN. 
>
>  
>
>  
>
>  
>
> Our current application has 3 parts:
>
>  
>
>  
>
> 1. web application back-end which is a WAR file deployed under JRUN
>
>  
>
> 2. web application front-end which is a set of JSPs, htmls, image files,
> javascripts, etc. deployed under IIS.
>
>  
>
> 3. A set of JSPs, JavaScript files which can be accessed by front-end. 
>
>  
>
>  
>
>  
>
> In case of IIS for example I have index.jsp under IIS which includes
> login.jsp which located under another directory - c:\comp\inc\login.jsp,
> when IIS calls index.jsp it redirects the page to JRUN, JRUN will complete
> the rest of the work and return result to IIS. But this doesn't work on
> Apache/Tomcat unless I put all files under Tomcat's webapps directory. Every
> time I call Index.jsp all I get in browser is full of html/jsp code in that
> file (on FF) or static contents with jsp code (on IE). It seems to me Apache
> /jk connector doesn't send the page to Tomcat but rather serve it as a
> static HTML page!
>
>  
>
>  
>
> I tried to change server.xml by adding Context, JK connector properties
> file, Apache httpd.conf by adding lines which specifies external resource
> but it didn't work out.
>
>  
>
>  
>
> Can anyone help me out? Thanks in advance!
>
>  
>
>  
>
>  
>
> /Victor
>
>  
>
>  
>
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org