]
Jason T. Greene updated JBAS-6562:
----------------------------------
Fix Version/s: Unscheduled
(was: 6.0.0.M3)
Unscheduling due to inactivity. Reassign to a release that you feel comfortable resolving
this issue in, or leave as is.
Context entries don't work as explained in tomcat docs.
-------------------------------------------------------
Key: JBAS-6562
URL:
https://jira.jboss.org/jira/browse/JBAS-6562
Project: JBoss Application Server
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: Web (Tomcat) service
Reporter: Vicky Kak
Fix For: Unscheduled
The documentation about the context configuration in Tomcat does not work in JbossAS
deployments.
I have just spend some time looking at the related code at
http://anonsvn.jboss.org/repos/jbossas/branches/JBPAPP_4_2/tomcat/src/mai...
Here is the code snippet
****************************************************************
private String findConfig(URL warURL) throws IOException
{
String result = null;
// See if the warUrl is a dir or a file
File warFile = new File(warURL.getFile());
if (warURL.getProtocol().equals("file") && warFile.isDirectory()
== true)
{
File webDD = new File(warFile, CONTEXT_CONFIG_FILE);
if (webDD.exists() == true) result = webDD.getAbsolutePath();
}
else
{
ZipFile zipFile = new ZipFile(warFile);
ZipEntry entry = zipFile.getEntry(CONTEXT_CONFIG_FILE);
if (entry != null)
{
InputStream zipIS = zipFile.getInputStream(entry);
byte[] buffer = new byte[512];
int bytes;
result = warFile.getAbsolutePath() + "-context.xml";
FileOutputStream fos = new FileOutputStream(result);
while ((bytes = zipIS.read(buffer)) > 0)
{
fos.write(buffer, 0, bytes);
}
zipIS.close();
fos.close();
}
zipFile.close();
}
return result;
}
****************************************************************
This code needs to be modified in such a way that it uses these configurations
**************************************************************************************
1. in the $CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default file: the
Context element information will be loaded by all webapps of that host
2. in individual files (with a ".xml" extension) in the
$CATALINA_HOME/conf/[enginename]/[hostname]/ directory. The name of the file (less the
.xml) extension will be used as the context path. Multi-level context paths may be defined
using #, e.g. context#path.xml. The default web application may be defined by using a file
called ROOT.xml.
3. if the previous file was not found for this application, in an individual file at
/META-INF/context.xml inside the application files
inside a Host element in the main conf/server.xml
**************************************************************************************
The point[3] is already rejected earlier by Scott, here is the related jira
https://jira.jboss.org/jira/browse/JBAS-2290
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: