It seems that JRun does not support the concept of "context", and the root of that
context, but
instead requires the creation of virtual mappings within the JRun servlet container to
address
context-relative path resolution.
Is it possible to define an "alias" in the Tomcat servlet container, the same way that
one defines
an alias in the httpd.conf file when working with the Apache web server?
I ask this because I am investigating the merits of Tomcat versus JRun 3.0, the
commercial servlet
engine that we are currently using for development and deployment. As part of my
investigation, I
am interested in using the same source code that we are currently working on and
deploying it on
the two different servlet engines. The problem is that all the include directives in
our source
files follow the context-relative path format that JRun is able to resolve, and I
don't want to
modify all the JSP pages to work "properly" since that would break the code for my
colleagues
working in the JRun environment.
Thanks,
Cor
-----Original Message-----
From: CPC Livelink Admin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 25, 2001 8:21 PM
To: [EMAIL PROTECTED]
Subject: RE: Problems with context-relative path include directive
The way it nehaves is that "/" is the root of your webapp. So, when doing
things with the servlet container alone, you would reference the file as
"/JSPHeader.jsp". If, however, you are sending something to the browser for
it to get, then do "<%= request.getContextPath() %>/JSPHeader.gif"
Somewhat weird, but it does make navigation from the root of your webapp
easier since the name (context path) of the webapp can be changed.
Regards,
Paul
-----Original Message-----
From: Cor Ruiten [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 25, 2001 11:03 PM
To: [EMAIL PROTECTED]
Subject: Problems with context-relative path include directive
I just installed Tomcat 3.2.1 on my Windows 2000 workstation.
I am able to start Tomcat and view the examples provided in the
distribution.
I made the following entry in the server.xml file so that I can reach my
application:
<Context path="/hcs"
docBase="d:/development/hcs/jsp"
crossContext="false"
debug="9"
reloadable="true" >
</Context>
If I attempt to serve up any JSP page that has the following include
directive:
<%@ include file="/hcs/JSPHeader.jsp" %>
I receive the following error:
Error: 500
Location: /hcs/sccp.jsp
Internal Servlet Error:
org.apache.jasper.compiler.CompileException:
D:\Development\hcs\jsp\sccp.jsp(0,0) Bad file
argument to include
at
org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEve
ntListener.java,
Compiled Code)
at
org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingList
ener.java:116)
at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java,
Compiled Code)
at org.apache.jasper.compiler.Parser.parse(Parser.java, Compiled
Code)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1042)
at org.apache.jasper.compiler.Parser.parse(Parser.java:1038)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java,
Compiled Code)
at
org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
at
org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at
org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:152)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:164)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:2
10)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java,
Compiled Code)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java,
Compiled Code)
at java.lang.Thread.run(Thread.java:479)
The same JSP pages work fine using JRun 3.0. But it appears that Tomcat is
not liking my
context-relative path include
statement because if I change the include to be:
<%@ include file="JSPHeader.jsp" %>
and the JSP page that make this include is at the "root" level for my
context, then Tomcat is
happy...
I was under the impression that my definition of the "/hcs" context should
have taken care of this.
Any thoughts on what I am doing wrong here?
Thank you,
Cor Ruiten
Pipeline Software, Inc.
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]