Re: Can't change servlet path

2005-09-25 Thread Paul Singleton

Caldarale, Charles R wrote:


In addition to nesting Context elements inside a Host element, you can
also store them:
...
* in individual files (with a .xml extension) in the
$CATALINA_HOME/conf/[enginename]/[hostname]/ directory

 ...

The value of this field ...t will be infered [sic] from the filenames
used for either the .xml context file or the docBase.


From which I infer that the Context element for the default
web application of a virtual host should be held in a file
named .xml

?

Paul Singleton


--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.6/111 - Release Date: 23/Sep/2005


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Can't change servlet path

2005-09-25 Thread Caldarale, Charles R
 From: Paul Singleton [mailto:[EMAIL PROTECTED] 
 Subject: Re: Can't change servlet path
 
  From which I infer that the Context element for the default
 web application of a virtual host should be held in a file
 named .xml

As with every rule, there are exceptions.  As I understand it, the
Context for the default app should be placed in ROOT.xml (caps
required).

 - 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 unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Can't change servlet path

2005-09-14 Thread David Thielen
Hi;

I'm not understanding something here I think. On (1) you say (I think) that
I must put Context in server.xml for the path attribute. But in (2) you
tell me (I think) to not put Context in server.xml?

What am I not getting here?

Thanks - dave


-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 13, 2005 9:27 PM
To: Tomcat Users List
Subject: RE: Can't change servlet path

 From: David Thielen [mailto:[EMAIL PROTECTED] 
 Subject: RE: Can't change servlet path
 
 1) Why is this forced in server.xml when otherwise we are 
 supposed to put everything in our META-INF?

You should consider the use of Context in server.xml as merely a
migration mechanism from older Tomcat versions.  The path attribute has
to be used in this situation, since there is no other means of
determining the application name.  For the other two cases, the
application name is derivable from either the location or the name of
the .xml file.

 2) In this case, is the context.xml in my META-INF used also? In other
 words, should I put the JDBC Resource node in the Context node in
 server.xml or in my context.xml?

You simply shouldn't have a Context tag in server.xml (see above).

 3) While /abc now works, /store still does too. Is this by design?

I suspect that your app has actually been deployed twice - once for each
of the Context instances you have.  I believe the normal way of
handling a single app that you want to use under multiple path names is
to have trivial secondary apps that merely forward requests to the real
one.  (Others may have better solutions, since I primarily work on the
inside of the JVM, not on J2EE apps.)

 - 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 unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Can't change servlet path

2005-09-14 Thread Caldarale, Charles R
 From: David Thielen [mailto:[EMAIL PROTECTED] 
 Subject: RE: Can't change servlet path
 
 I'm not understanding something here I think. On (1) you say 
 (I think) that I must put Context in server.xml for the path
 attribute. But in (2) you tell me (I think) to not put Context
 in server.xml?
 
 What am I not getting here?

You should not put Context elements in server.xml, nor should you use
the path attribute.  Name the application appropriately.

 - 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 unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Can't change servlet path

2005-09-13 Thread Caldarale, Charles R
 From: David Thielen [mailto:[EMAIL PROTECTED] 
 Subject: Can't change servlet path
 
 I have tried the following in context.xml (in 
 webapps/store/WEB-INF and META-INF):

Please read the very explicit doc:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html

(Since you didn't bother to tell us which Tomcat version you're using,
you'll need to adjust the above URL appropriately.)

In particular, the above says:

In addition to nesting Context elements inside a Host element, you can
also store them:
* in the individual $CATALINA_HOME/conf/context.xml file: the
Context element information will be loaded by all webapps
* in the individual
$CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default file:
the Context element information will be loaded by all webapps of that
host
* in individual files (with a .xml extension) in the
$CATALINA_HOME/conf/[enginename]/[hostname]/ directory
* if the previous file was not found for this application, in
individual file at /META-INF/context.xml inside the application files

Please note that for tomcat 5, unlike tomcat 4.x, it is NOT recommended
to place Context elements directly in the server.xml file.  Instead,
put them in the META-INF/context.xml directory of your WAR file or the
conf directory as described above.

If you are using 5.5, also note the following for the path attribute:

The value of this field must not be set except when statically defining
a Context in server.xml, as it will be infered [sic] from the filenames
used for either the .xml context file or the docBase.

 - 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 unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Can't change servlet path

2005-09-13 Thread Barnett, Brian W.
You may want to consider using the jTDS (http://jtds.sourceforge.net/) SQL
Server driver also. It is faster and more reliable.

Sample ResourceParams entries:

parameter
namedriverClassName/name
valuenet.sourceforge.jtds.jdbc.Driver/value
/parameter
parameter
nameurl/name

valuejdbc:jtds:sqlserver://host:port/db;user=username;password=password/v
alue
/parameter

-Original Message-
From: David Thielen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 13, 2005 3:51 PM
To: tomcat-user@jakarta.apache.org
Subject: Can't change servlet path


Hi;

 

I have tried the following in context.xml (in webapps/store/WEB-INF and
META-INF):

 

Context path=/abc docBase=store debug=5 reloadable=true
crossContext=true

  Resource name=jdbc/storeDB auth=Container
type=javax.sql.DataSource

username=sa password=*
driverClassName=com.microsoft.jdbc.sqlserver.SQLServerDriver

 
url=jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=StoreTest;Select
Method=cursor

maxActive=8 maxIdle=4/

/Context

 

But http://localhost:8080/abc/ fails while http://localhost:8080/store/
works. What am I doing wrong?

 

Also, does context.xml go in WEB-INF or META-INF?

 

Thanks - dave

 

 


 
This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Can't change servlet path

2005-09-13 Thread David Thielen
Hello;

I am using Tomcat 5.5 (which is really nice).

1) I have no Context nodes in server.xml

2) Tomcat 5.5\conf\context.xml is:
Context
WatchedResourceWEB-INF/web.xml/WatchedResource
/Context

3) Tomcat 5.5\webapps\store\META-INF\context.xml is:
Context path=/abc docBase=store debug=5 reloadable=true
crossContext=true
Resource name=jdbc/storeDB auth=Container
type=javax.sql.DataSource username=sa password=*
driverClassName=com.microsoft.jdbc.sqlserver.SQLServerDriver
url=jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=StoreTest;Select
Method=cursor maxActive=8 maxIdle=4/
/Context

Yet http://localhost:8080/abc fails and http://localhost:8080/store
succeeds.

I've read all the docs and it seems to me this is supposed to work.

What am I missing

Thanks - dave


-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 13, 2005 3:59 PM
To: Tomcat Users List
Subject: RE: Can't change servlet path

 From: David Thielen [mailto:[EMAIL PROTECTED] 
 Subject: Can't change servlet path
 
 I have tried the following in context.xml (in 
 webapps/store/WEB-INF and META-INF):

Please read the very explicit doc:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html

(Since you didn't bother to tell us which Tomcat version you're using,
you'll need to adjust the above URL appropriately.)

In particular, the above says:

In addition to nesting Context elements inside a Host element, you can
also store them:
* in the individual $CATALINA_HOME/conf/context.xml file: the
Context element information will be loaded by all webapps
* in the individual
$CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default file:
the Context element information will be loaded by all webapps of that
host
* in individual files (with a .xml extension) in the
$CATALINA_HOME/conf/[enginename]/[hostname]/ directory
* if the previous file was not found for this application, in
individual file at /META-INF/context.xml inside the application files

Please note that for tomcat 5, unlike tomcat 4.x, it is NOT recommended
to place Context elements directly in the server.xml file.  Instead,
put them in the META-INF/context.xml directory of your WAR file or the
conf directory as described above.

If you are using 5.5, also note the following for the path attribute:

The value of this field must not be set except when statically defining
a Context in server.xml, as it will be infered [sic] from the filenames
used for either the .xml context file or the docBase.

 - 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 unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Can't change servlet path

2005-09-13 Thread Caldarale, Charles R
 From: David Thielen [mailto:[EMAIL PROTECTED] 
 Subject: RE: Can't change servlet path
 
 3) Tomcat 5.5\webapps\store\META-INF\context.xml is:
   Context path=/abc docBase=store debug=5 reloadable=true
 crossContext=true
   /Context
 
 What am I missing

To repeat (3rd time today):

 If you are using 5.5, also note the following for the path attribute:
 
 The value of this field must not be set except when 
 statically defining a Context in server.xml, as it will
 be infered [sic] from the filenames used for either the
 .xml context file or the docBase.

 - 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 unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Can't change servlet path

2005-09-13 Thread David Thielen
Hi;

I'm sorry - I saw all the notes about don't put anything in server.xml and
so skipped over that part.

Out of curiosity, three questions:

1) Why is this forced in server.xml when otherwise we are supposed to put
everything in our META-INF?

2) In this case, is the context.xml in my META-INF used also? In other
words, should I put the JDBC Resource node in the Context node in
server.xml or in my context.xml?

3) While /abc now works, /store still does too. Is this by design?

Thanks again - dave


-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 13, 2005 5:42 PM
To: Tomcat Users List
Subject: RE: Can't change servlet path

 From: David Thielen [mailto:[EMAIL PROTECTED] 
 Subject: RE: Can't change servlet path
 
 3) Tomcat 5.5\webapps\store\META-INF\context.xml is:
   Context path=/abc docBase=store debug=5 reloadable=true
 crossContext=true
   /Context
 
 What am I missing

To repeat (3rd time today):

 If you are using 5.5, also note the following for the path attribute:
 
 The value of this field must not be set except when 
 statically defining a Context in server.xml, as it will
 be infered [sic] from the filenames used for either the
 .xml context file or the docBase.

 - 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 unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Can't change servlet path

2005-09-13 Thread Caldarale, Charles R
 From: David Thielen [mailto:[EMAIL PROTECTED] 
 Subject: RE: Can't change servlet path
 
 1) Why is this forced in server.xml when otherwise we are 
 supposed to put everything in our META-INF?

You should consider the use of Context in server.xml as merely a
migration mechanism from older Tomcat versions.  The path attribute has
to be used in this situation, since there is no other means of
determining the application name.  For the other two cases, the
application name is derivable from either the location or the name of
the .xml file.

 2) In this case, is the context.xml in my META-INF used also? In other
 words, should I put the JDBC Resource node in the Context node in
 server.xml or in my context.xml?

You simply shouldn't have a Context tag in server.xml (see above).

 3) While /abc now works, /store still does too. Is this by design?

I suspect that your app has actually been deployed twice - once for each
of the Context instances you have.  I believe the normal way of
handling a single app that you want to use under multiple path names is
to have trivial secondary apps that merely forward requests to the real
one.  (Others may have better solutions, since I primarily work on the
inside of the JVM, not on J2EE apps.)

 - 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 unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]