You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Paul landolt <la...@royalsys.com> on 2002/07/08 17:18:44 UTC
Tomcat 4.0.3 and relative path includes.
Hello All. I am a New poster, so I hope I'm following proper protocol.
I am having trouble with relative path @includes in Tomcat 4.0.3. An
include from the same directory is fine, as is an include from a
sub-directory, like so:
<%@include file="inc.jsp"%>
<%@include file="test2/inc.jsp"%>
However, trying to include from a higher directory generates a JSP
compile error. The JSP code:
<%@include file="../inc.jsp"%>
generates the following error message:
org.apache.jasper.compiler.CompileException:
/testdir/test2/index.jsp(5,0) File "../inc.jsp" not found
(There's lots more to the dump, but I didn't think it was pertinent. And
yes, the file IS there)
So, here are my questions:
1) Is this a known issue? Have other people encountered this?
2) Is this a bug or a Spec feature? If a bug is there a bug report
pending on this?
3) Is there a viable workaround for this?
4) Is there a mechanism in JSP to determine the current directory (and
therefor build up an absolute path)?
Thanks
...Paul
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Tomcat 4.0.4 and relative path includes.
Posted by Paul landolt <la...@royalsys.com>.
My mistake, that was Tomcat v4.0.4, not v 4.0.3
Paul landolt wrote:
> Hello All. I am a New poster, so I hope I'm following proper protocol.
>
> I am having trouble with relative path @includes in Tomcat 4.0.3. An
> include from the same directory is fine, as is an include from a
> sub-directory, like so:
>
> <%@include file="inc.jsp"%>
> <%@include file="test2/inc.jsp"%>
>
> However, trying to include from a higher directory generates a JSP
> compile error. The JSP code:
>
> <%@include file="../inc.jsp"%>
>
> generates the following error message:
>
> org.apache.jasper.compiler.CompileException:
> /testdir/test2/index.jsp(5,0) File "../inc.jsp" not found
>
> (There's lots more to the dump, but I didn't think it was pertinent. And
> yes, the file IS there)
>
> So, here are my questions:
>
> 1) Is this a known issue? Have other people encountered this?
> 2) Is this a bug or a Spec feature? If a bug is there a bug report
> pending on this?
> 3) Is there a viable workaround for this?
> 4) Is there a mechanism in JSP to determine the current directory (and
> therefor build up an absolute path)?
>
> Thanks
>
> ...Paul
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Tomcat 4.0.3 and relative path includes.
Posted by Paul landolt <la...@royalsys.com>.
A bug was generated to deal with this info, and a patch was sumbitted for comittment
to the source. For those interested, the bug is here:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10629
Thanks Andrew
...Paul
Paul landolt wrote:
> After some digging by Andrew, it appears that there may be some issuea with how
> <@include>'s are performed within a war file rather than with a deployed app.
>
> If the application is deployed as a directory (the war file unpacked into a
> directory) then Jasper has no troubles at all finding "../testdir/inc.jsp".
> However, it cannot find the file if the app is deployed as a war file. I would
> assume that the reason I could not find a similar problem when deploying the war
> file in Weblogic is because Weblogic may expand the war file into a temporary
> directory before execution.
>
> Has anyone else experienced similar issues with expanded vs War file webapps?
>
> ...Paul
>
> Andrew Conrad wrote:
>
> > Little background real quick. Tomcat allows you to define an
> > application Context in the server.xml
> >
> > Such that, if you wanted a webapp called MyApp, you would set up a
> > Context in your server.xml file with the path "/MyApp" and the docBase
> > attribute pointing to the location of your web app. In my testing, you
> > could use relative paths WITHIN your Context. Meaning
> >
> > If you had a file
> > /MyApp/testdir1/getRelative.jsp
> >
> > You could include these files:
> >
> > /myApp/inc.jsp (using "../inc.jsp" OR "/inc.jsp" )
> > /myApp/testdir1/inc.jsp (using "inc.jsp" or "/testdir1/inc.jsp")
> > /myApp/testdir2/inc.jsp (using "../testdir2/inc.jsp" or
> > "/testdir2/inc.jsp" )
> >
> > What you couldn't do was leave your Context and get something else
> > (like):
> >
> > /inc.jsp
> > /YourApp/inc.jsp
> >
> > According to the Servlet 2.3 specification, I do not believe this is a
> > bug. (SRV9.5)
> >
> > "A web application exists as a structured hierarchy of directories. The
> > root of this
> > hierarchy serves as the document root for files that are part of the
> > application."
> >
> > That seems to say that everything within the "MyApp" webapp should see
> > the directory as "/" and you cannot go below root.
> >
> > This seems to be consistent with the JSP 1.2 Documentation for
> > <jsp:include /> and <%@ include %> tags
> > (JSP 2.10.3; JSP 4.4)
> >
> > -Andrew
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Apache2.0.39 VirtualHosts Does not work Even when tomcat is out!
Posted by Luminous Heart <lu...@yahoo.com>.
I have disabled tomcat for this experiment. I have
built apache2.0.39 with tomcat4.0.4 on RH linux7.1.
I have two domain names that use one ip address:
- domain1.com
- domain2.com
- ip: 10.0.0.15
the two domains point at two directories:
- /usr/local/apache2/htdocs/domain1
- /usr/local/apache2/htdocs/domain2
My configuration is not working for any domain. I have
disabled tomcat and removed domain2. When I point my
browser at http://www.domain1.com I get an index.html
page that is located on /usr/local/apache2/htdocs and
NOT the one in domain1. Even when I point at
http://www.domain2.com I still get the same.
To troubleshoot, I renamed the whole directory htdocs
into webpages to see if apache is seeking that
directory regardless of my configuration. It seems
that my findings are true. Now when I point my browser
at either domain I get a 403 error
"Access forbidden!
You don't have permission to access the requested
directory. There is either no index document or the
directory is read-protected.
If you think this is a server error, please contact
the webmaster
Error 403
"
I am attaching my httpd.conf file so someone might
take a look and tell me where am going wrong.
Thank you all in advance.
<Dump-Of-File-HTTPD.CONF>
ServerRoot "/usr/local/apache2"
<IfModule !mpm_winnt.c>
<IfModule !mpm_netware.c>
#LockFile logs/accept.lock
</IfModule>
</IfModule>
<IfModule !mpm_netware.c>
<IfModule !perchild.c>
#ScoreBoardFile logs/apache_runtime_status
</IfModule>
</IfModule>
<IfModule !mpm_netware.c>
PidFile logs/httpd.pid
</IfModule>
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 150
MaxRequestsPerChild 0
</IfModule>
<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
<IfModule perchild.c>
NumServers 5
StartThreads 5
MinSpareThreads 5
MaxSpareThreads 10
MaxThreadsPerChild 20
MaxRequestsPerChild 0
</IfModule>
Listen 2003
#Listen 80
LoadModule access_module modules/mod_access.so
LoadModule auth_module modules/mod_auth.so
LoadModule auth_anon_module modules/mod_auth_anon.so
LoadModule auth_dbm_module modules/mod_auth_dbm.so
LoadModule auth_digest_module
modules/mod_auth_digest.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
LoadModule usertrack_module modules/mod_usertrack.so
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
<IfDefine SSL>
LoadModule ssl_module modules/mod_ssl.so
</IfDefine>
LoadModule mime_module modules/mod_mime.so
LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule asis_module modules/mod_asis.so
LoadModule info_module modules/mod_info.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule vhost_alias_module
modules/mod_vhost_alias.so
LoadModule negotiation_module
modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
LoadModule imap_module modules/mod_imap.so
LoadModule actions_module modules/mod_actions.so
LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
ExtendedStatus On
<IfModule !mpm_winnt.c>
<IfModule !mpm_netware.c>
User nobody
Group #-1
</IfModule>
</IfModule>
ServerAdmin webmaster@domain1.com
ServerName www.domain1.com
UseCanonicalName Off
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
UserDir public_html
DirectoryIndex index.html index.jsp index.html.var
AccessFileName .htaccess
<Files ~ "^\.ht">
Order allow,deny
Deny from all
</Files>
TypesConfig conf/mime.types
DefaultType text/plain
<IfModule mod_mime_magic.c>
MIMEMagicFile conf/magic
</IfModule>
HostnameLookups Off
ErrorLog logs/error_log
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
CustomLog logs/access_log common
CustomLog logs/referer_log referer
CustomLog logs/agent_log agent
ServerSignature On
Alias /icons/ "/usr/local/apache2/icons/"
<Directory "/usr/local/apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Alias /manual "/usr/local/apache2/manual"
<Directory "/usr/local/apache2/manual">
Options Indexes FollowSymLinks MultiViews
IncludesNoExec
AddOutputFilter Includes html
AllowOverride None
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
<IfModule mod_cgid.c>
</IfModule>
<Directory "/usr/local/apache2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
# Redirect permanent /foo http://www.example.com/bar
IndexOptions FancyIndexing VersionSort
AddIconByEncoding (CMP,/icons/compressed.gif)
x-compress x-gzip
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh
.tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
DefaultIcon /icons/unknown.gif
ReadmeName README.html
HeaderName HEADER.html
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
AddEncoding x-compress Z
AddEncoding x-gzip gz tgz
AddLanguage da .dk
AddLanguage ar .ar
AddLanguage nl .nl
AddLanguage en .en
AddLanguage et .et
AddLanguage fr .fr
AddLanguage de .de
AddLanguage he .he
AddLanguage el .el
AddLanguage it .it
AddLanguage ja .ja
AddLanguage pl .po
AddLanguage ko .ko
AddLanguage pt .pt
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pt-br .pt-br
AddLanguage ltz .ltz
AddLanguage ca .ca
AddLanguage es .es
AddLanguage sv .se
AddLanguage cz .cz
AddLanguage ru .ru
AddLanguage tw .tw
AddLanguage zh-tw .tw
AddLanguage hr .hr
LanguagePriority ar en da nl et fr de el it ja ko no
pl pt pt-br ltz ca es sv tw
ForceLanguagePriority Prefer Fallback
AddDefaultCharset ISO-8859-1
AddCharset ISO-8859-1 .iso8859-1 .latin1
AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
AddCharset ISO-8859-3 .iso8859-3 .latin3
AddCharset ISO-8859-4 .iso8859-4 .latin4
AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr
.iso-ru
AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb
AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk
AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb
AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5 .Big5 .big5
# For russian, more than one charset is used (depends
on client, mostly):
AddCharset WINDOWS-1251 .cp-1251 .win-1251
AddCharset CP866 .cp866
AddCharset KOI8-r .koi8-r .koi8-ru
AddCharset KOI8-ru .koi8-uk .ua
AddCharset ISO-10646-UCS-2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-8 .utf8
AddCharset GB2312 .gb2312 .gb
AddCharset utf-7 .utf7
AddCharset utf-8 .utf8
AddCharset big5 .big5 .b5
AddCharset EUC-TW .euc-tw
AddCharset EUC-JP .euc-jp
AddCharset EUC-KR .euc-kr
AddCharset shift_jis .sjis
AddType application/x-tar .tgz
AddHandler type-map var
<IfModule mod_negotiation.c>
<IfModule mod_include.c>
Alias /error/ "/usr/local/apache2/error/"
<Directory "/usr/local/apache2/error">
AllowOverride None
Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
Order allow,deny
Allow from all
LanguagePriority en es de fr
ForceLanguagePriority Prefer Fallback
</Directory>
ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
ErrorDocument 401
/error/HTTP_UNAUTHORIZED.html.var
ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
ErrorDocument 405
/error/HTTP_METHOD_NOT_ALLOWED.html.var
ErrorDocument 408
/error/HTTP_REQUEST_TIME_OUT.html.var
ErrorDocument 410 /error/HTTP_GONE.html.var
ErrorDocument 411
/error/HTTP_LENGTH_REQUIRED.html.var
ErrorDocument 412
/error/HTTP_PRECONDITION_FAILED.html.var
ErrorDocument 413
/error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
ErrorDocument 414
/error/HTTP_REQUEST_URI_TOO_LARGE.html.var
ErrorDocument 415
/error/HTTP_SERVICE_UNAVAILABLE.html.var
ErrorDocument 500
/error/HTTP_INTERNAL_SERVER_ERROR.html.var
ErrorDocument 501
/error/HTTP_NOT_IMPLEMENTED.html.var
ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
ErrorDocument 503
/error/HTTP_SERVICE_UNAVAILABLE.html.var
ErrorDocument 506
/error/HTTP_VARIANT_ALSO_VARIES.html.var
</IfModule>
</IfModule>
BrowserMatch "Mozilla/2" nokeepalive
BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0
force-response-1.0
BrowserMatch "RealPlayer 4\.0" force-response-1.0
BrowserMatch "Java/1\.0" force-response-1.0
BrowserMatch "JDK/1\.0" force-response-1.0
BrowserMatch "Microsoft Data Access Internet
Publishing Provider" redirect-carefully
BrowserMatch "^WebDrive" redirect-carefully
NameVirtualHost 10.0.0.15:2003
NameVirtualHost 10.0.0.15:443
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from .domain1.com
</Location>
<Location /server-info>
SetHandler server-info
Order deny,allow
Deny from all
Allow from .domain1.com
</Location>
<IfModule mod_ssl.c>
Include conf/ssl.conf
</IfModule>
#Include /usr/local/tomcat/conf/prod_jk.conf
<VirtualHost 10.0.0.15:2003>
ServerName www.domain1.com
ServerAlias domain1.com
DocumentRoot "/usr/local/apache2/webpages/domain1"
# JkMount /* ajp13
# JkMount /servlet/* ajp13
<Directory "/usr/local/apache2/webpages/domain1" >
Options FollowSymLinks
Options Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
ErrorLog logs/domain1.com.error_log
CustomLog logs/domain1.com.access_log common
CustomLog logs/domain1.com.referer_log referer
CustomLog logs/domain1.com.agent_log agent
</VirtualHost>
</Dump-Of-File-HTTPD.CONF>
__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Tomcat 4.0.3 and relative path includes.
Posted by Paul landolt <la...@royalsys.com>.
After some digging by Andrew, it appears that there may be some issuea with how
<@include>'s are performed within a war file rather than with a deployed app.
If the application is deployed as a directory (the war file unpacked into a
directory) then Jasper has no troubles at all finding "../testdir/inc.jsp".
However, it cannot find the file if the app is deployed as a war file. I would
assume that the reason I could not find a similar problem when deploying the war
file in Weblogic is because Weblogic may expand the war file into a temporary
directory before execution.
Has anyone else experienced similar issues with expanded vs War file webapps?
...Paul
Andrew Conrad wrote:
> Little background real quick. Tomcat allows you to define an
> application Context in the server.xml
>
> Such that, if you wanted a webapp called MyApp, you would set up a
> Context in your server.xml file with the path "/MyApp" and the docBase
> attribute pointing to the location of your web app. In my testing, you
> could use relative paths WITHIN your Context. Meaning
>
> If you had a file
> /MyApp/testdir1/getRelative.jsp
>
> You could include these files:
>
> /myApp/inc.jsp (using "../inc.jsp" OR "/inc.jsp" )
> /myApp/testdir1/inc.jsp (using "inc.jsp" or "/testdir1/inc.jsp")
> /myApp/testdir2/inc.jsp (using "../testdir2/inc.jsp" or
> "/testdir2/inc.jsp" )
>
> What you couldn't do was leave your Context and get something else
> (like):
>
> /inc.jsp
> /YourApp/inc.jsp
>
> According to the Servlet 2.3 specification, I do not believe this is a
> bug. (SRV9.5)
>
> "A web application exists as a structured hierarchy of directories. The
> root of this
> hierarchy serves as the document root for files that are part of the
> application."
>
> That seems to say that everything within the "MyApp" webapp should see
> the directory as "/" and you cannot go below root.
>
> This seems to be consistent with the JSP 1.2 Documentation for
> <jsp:include /> and <%@ include %> tags
> (JSP 2.10.3; JSP 4.4)
>
> -Andrew
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Tomcat 4.0.3 and relative path includes.
Posted by Andrew Conrad <an...@msn.com>.
Little background real quick. Tomcat allows you to define an
application Context in the server.xml
Such that, if you wanted a webapp called MyApp, you would set up a
Context in your server.xml file with the path "/MyApp" and the docBase
attribute pointing to the location of your web app. In my testing, you
could use relative paths WITHIN your Context. Meaning
If you had a file
/MyApp/testdir1/getRelative.jsp
You could include these files:
/myApp/inc.jsp (using "../inc.jsp" OR "/inc.jsp" )
/myApp/testdir1/inc.jsp (using "inc.jsp" or "/testdir1/inc.jsp")
/myApp/testdir2/inc.jsp (using "../testdir2/inc.jsp" or
"/testdir2/inc.jsp" )
What you couldn't do was leave your Context and get something else
(like):
/inc.jsp
/YourApp/inc.jsp
According to the Servlet 2.3 specification, I do not believe this is a
bug. (SRV9.5)
"A web application exists as a structured hierarchy of directories. The
root of this
hierarchy serves as the document root for files that are part of the
application."
That seems to say that everything within the "MyApp" webapp should see
the directory as "/" and you cannot go below root.
This seems to be consistent with the JSP 1.2 Documentation for
<jsp:include /> and <%@ include %> tags
(JSP 2.10.3; JSP 4.4)
-Andrew
-----Original Message-----
From: Paul landolt [mailto:landolt@royalsys.com]
Sent: Monday, July 08, 2002 1:39 PM
To: Tomcat Users List
Subject: Re: Tomcat 4.0.3 and relative path includes.
1) I'm not precisely clear on your use of the Context (I am a tad new at
this). I would assume from your question that the proper response is
this: I am tryig to leave my current Context and go to a 'parent'
Context, not nessesarily the base context.
My test structure works out to the following:
docroot/index.html
docroot/testdir/index.jsp
docroot/testdir/inc.jsp
docroot/testdir/test2/index.jsp
docroot/testdir/test2/inc.jsp
The "not found" error occures when I try to include
docroot/testdir/inc.jsp (which is in the parent directory) from the file
docroot/testdir/test2/index.jsp
2) I have tried setting the CrossContext attribute to true as well as
false, both having no affect
3) Although the option still exists to create a subdirectory off of the
base context, I am trying to port an existing web app from Weblogic onto
Tomcat. I would like to avoid moving files around if possible.
What about the use of the <jsp:directive.include /> phrase rather than
<@include>? Are there substantial differences?
Andrew Conrad wrote:
> So you are trying to leave your current Context and go into the base
> context?
>
> Have you set your Context attribute "CrossContext" to true?
>
> Have you tried making a subdirectory in your current Context, place
> this file with the relative include in it, and tried to request the
> file from the base of the current context to see if that has any
> problems?
>
> - Andrew
>
> -----Original Message-----
> From: Paul landolt [mailto:landolt@royalsys.com]
> Sent: Monday, July 08, 2002 11:19 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Tomcat 4.0.3 and relative path includes.
>
> Hello All. I am a New poster, so I hope I'm following proper protocol.
>
> I am having trouble with relative path @includes in Tomcat 4.0.3. An
> include from the same directory is fine, as is an include from a
> sub-directory, like so:
>
> <%@include file="inc.jsp"%>
> <%@include file="test2/inc.jsp"%>
>
> However, trying to include from a higher directory generates a JSP
> compile error. The JSP code:
>
> <%@include file="../inc.jsp"%>
>
> generates the following error message:
>
> org.apache.jasper.compiler.CompileException:
> /testdir/test2/index.jsp(5,0) File "../inc.jsp" not found
>
> (There's lots more to the dump, but I didn't think it was pertinent.
> And yes, the file IS there)
>
> So, here are my questions:
>
> 1) Is this a known issue? Have other people encountered this?
> 2) Is this a bug or a Spec feature? If a bug is there a bug report
> pending on this?
> 3) Is there a viable workaround for this?
> 4) Is there a mechanism in JSP to determine the current directory (and
> therefor build up an absolute path)?
>
> Thanks
>
> ...Paul
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Tomcat 4.0.3 and relative path includes.
Posted by Paul landolt <la...@royalsys.com>.
1) I'm not precisely clear on your use of the Context (I am a tad new at this). I
would assume from your question that the proper response is this: I am tryig to
leave my current Context and go to a 'parent' Context, not nessesarily the base
context.
My test structure works out to the following:
docroot/index.html
docroot/testdir/index.jsp
docroot/testdir/inc.jsp
docroot/testdir/test2/index.jsp
docroot/testdir/test2/inc.jsp
The "not found" error occures when I try to include docroot/testdir/inc.jsp
(which is in the parent directory) from the file docroot/testdir/test2/index.jsp
2) I have tried setting the CrossContext attribute to true as well as false, both
having no affect
3) Although the option still exists to create a subdirectory off of the base
context, I am trying to port an existing web app from Weblogic onto Tomcat. I
would like to avoid moving files around if possible.
What about the use of the <jsp:directive.include /> phrase rather than
<@include>? Are there substantial differences?
Andrew Conrad wrote:
> So you are trying to leave your current Context and go into the base
> context?
>
> Have you set your Context attribute "CrossContext" to true?
>
> Have you tried making a subdirectory in your current Context, place this
> file with the relative include in it, and tried to request the file from
> the base of the current context to see if that has any problems?
>
> - Andrew
>
> -----Original Message-----
> From: Paul landolt [mailto:landolt@royalsys.com]
> Sent: Monday, July 08, 2002 11:19 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Tomcat 4.0.3 and relative path includes.
>
> Hello All. I am a New poster, so I hope I'm following proper protocol.
>
> I am having trouble with relative path @includes in Tomcat 4.0.3. An
> include from the same directory is fine, as is an include from a
> sub-directory, like so:
>
> <%@include file="inc.jsp"%>
> <%@include file="test2/inc.jsp"%>
>
> However, trying to include from a higher directory generates a JSP
> compile error. The JSP code:
>
> <%@include file="../inc.jsp"%>
>
> generates the following error message:
>
> org.apache.jasper.compiler.CompileException: /testdir/test2/index.jsp(5,0)
> File "../inc.jsp" not found
>
> (There's lots more to the dump, but I didn't think it was pertinent. And
> yes, the file IS there)
>
> So, here are my questions:
>
> 1) Is this a known issue? Have other people encountered this?
> 2) Is this a bug or a Spec feature? If a bug is there a bug report
> pending on this?
> 3) Is there a viable workaround for this?
> 4) Is there a mechanism in JSP to determine the current directory (and
> therefor build up an absolute path)?
>
> Thanks
>
> ...Paul
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Tomcat 4.0.3 and relative path includes.
Posted by Paul landolt <la...@royalsys.com>.
Andrew,
Perhaps you might be able to take a quick peek at my demo web app to see if
there's any way of getting this working, or at least to give a rudimentary
explanation as to why it won't (or shouldn't) work. It is worth noting that this
very war file was deployed on Bea Weblogic 6.1 and it works with no problems.
I've included my demo war file. It's fairly minute (3K) so it shouldn't be to
hard to review
The Context entry for this app is in ,y conf/server.xml as follows:
<!-- ServerTest Context -->
<Context path="/ServerTest"
docBase="C:/jakarta-tomcat-4.0.4/deploy/ServerTest.war" debug="0"
reloadable="true" CrossContext="true">
</Context>
Thanks in advance
...Paul
Andrew Conrad wrote:
> So you are trying to leave your current Context and go into the base
> context?
>
> Have you set your Context attribute "CrossContext" to true?
>
> Have you tried making a subdirectory in your current Context, place this
> file with the relative include in it, and tried to request the file from
> the base of the current context to see if that has any problems?
>
> - Andrew
>
> -----Original Message-----
> From: Paul landolt [mailto:landolt@royalsys.com]
> Sent: Monday, July 08, 2002 11:19 AM
> To: tomcat-user@jakarta.apache.org
> Subject: Tomcat 4.0.3 and relative path includes.
>
> Hello All. I am a New poster, so I hope I'm following proper protocol.
>
> I am having trouble with relative path @includes in Tomcat 4.0.3. An
> include from the same directory is fine, as is an include from a
> sub-directory, like so:
>
> <%@include file="inc.jsp"%>
> <%@include file="test2/inc.jsp"%>
>
> However, trying to include from a higher directory generates a JSP
> compile error. The JSP code:
>
> <%@include file="../inc.jsp"%>
>
> generates the following error message:
>
> org.apache.jasper.compiler.CompileException:
> /testdir/test2/index.jsp(5,0) File "../inc.jsp" not found
>
> (There's lots more to the dump, but I didn't think it was pertinent. And
> yes, the file IS there)
>
> So, here are my questions:
>
> 1) Is this a known issue? Have other people encountered this?
> 2) Is this a bug or a Spec feature? If a bug is there a bug report
> pending on this?
> 3) Is there a viable workaround for this?
> 4) Is there a mechanism in JSP to determine the current directory (and
> therefor build up an absolute path)?
>
> Thanks
>
> ...Paul
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Tomcat 4.0.3 and relative path includes.
Posted by Andrew Conrad <an...@msn.com>.
So you are trying to leave your current Context and go into the base
context?
Have you set your Context attribute "CrossContext" to true?
Have you tried making a subdirectory in your current Context, place this
file with the relative include in it, and tried to request the file from
the base of the current context to see if that has any problems?
- Andrew
-----Original Message-----
From: Paul landolt [mailto:landolt@royalsys.com]
Sent: Monday, July 08, 2002 11:19 AM
To: tomcat-user@jakarta.apache.org
Subject: Tomcat 4.0.3 and relative path includes.
Hello All. I am a New poster, so I hope I'm following proper protocol.
I am having trouble with relative path @includes in Tomcat 4.0.3. An
include from the same directory is fine, as is an include from a
sub-directory, like so:
<%@include file="inc.jsp"%>
<%@include file="test2/inc.jsp"%>
However, trying to include from a higher directory generates a JSP
compile error. The JSP code:
<%@include file="../inc.jsp"%>
generates the following error message:
org.apache.jasper.compiler.CompileException:
/testdir/test2/index.jsp(5,0) File "../inc.jsp" not found
(There's lots more to the dump, but I didn't think it was pertinent. And
yes, the file IS there)
So, here are my questions:
1) Is this a known issue? Have other people encountered this?
2) Is this a bug or a Spec feature? If a bug is there a bug report
pending on this?
3) Is there a viable workaround for this?
4) Is there a mechanism in JSP to determine the current directory (and
therefor build up an absolute path)?
Thanks
...Paul
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>