You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Erik Price <ep...@ptc.com> on 2003/01/03 19:23:46 UTC

web.xml format

Just a simple question -- if I want to use an ampersand (or other 
character that is significant in XML), do I need to escape it with an 
entity in the web.xml ?

For instance, is this valid:

<context-param>
   <param-name>dbConnectUrl</param-name>
   <param-value>
     jdbc:mysql://localhost:3306/eprice?user=eprice&amp;password=pass
   </param-value>
</context-param>

(Note entity used in querystring of URL.)

Also, is okay to have the URL there on its own line, or will the 
whitespace before and after the URL be added to any 
getServletContext().getInitParameter() calls?


Thanks!

Erik


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: servlet path

Posted by Andreas Probst <an...@gmx.net>.
Hi Vladimer,

look for servlet mapping in the archive and/or in the servlet 
spec.

In web.xml you can put a servlet mapping like

<servlet-mapping>
   <servlet-name>webdav</servlet-name>
   <url-pattern>/</url-pattern>
</servlet-mapping>  

which routs every request to the servlet, which's name is 
webdav.

You might want a mapping like the next one, but I'm not sure, as 
I've never done this before.

<servlet-mapping>
   <servlet-name>xxxx</servlet-name>
   <url-pattern>/xxxx</url-pattern>
</servlet-mapping>  

Andreas



On 3 Jan 2003 at 15:06, Vladimer Shioshvili wrote:

> 
> 
> 
> for some reason i remember seeing somewhere that i can painlessly
> change how servlets are accessed. by this i mean removing
> /servlet for URI path and using xx.com/xxxx instead of
> xx.com/servlet/xxxx.
> 
> any help appreciated,
> Vlad
> 
> 
> ________________
> Vladimer Shioshvili
> 
> QRC Division of Macro International Inc.
> 7315 Wisconsin Avenue, Suite 400W
> Bethesda, MD 20814
> 
> Phone: (301) 657 3077 ext. 155 
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: servlet path

Posted by Jacob Kjome <ho...@visi.com>.
Look into <servlet-mappng> element in the web.xml.

If you are not already familiar with this, you really need a good book like 
Java Servlet Programming from Jason Hunter.  This is pretty basic stuff.

Jake

At 03:06 PM 1/3/2003 -0500, you wrote:



>for some reason i remember seeing somewhere that i can painlessly change 
>how servlets are accessed. by this i mean removing /servlet for URI path 
>and using xx.com/xxxx instead of xx.com/servlet/xxxx.
>
>any help appreciated,
>Vlad
>
>
>________________
>Vladimer Shioshvili
>
>QRC Division of Macro International Inc.
>7315 Wisconsin Avenue, Suite 400W
>Bethesda, MD 20814
>
>Phone: (301) 657 3077 ext. 155
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

servlet path

Posted by Vladimer Shioshvili <vs...@qrc.com>.


for some reason i remember seeing somewhere that i can painlessly change 
how servlets are accessed. by this i mean removing /servlet for URI path 
and using xx.com/xxxx instead of xx.com/servlet/xxxx.

any help appreciated,
Vlad


________________
Vladimer Shioshvili

QRC Division of Macro International Inc.
7315 Wisconsin Avenue, Suite 400W
Bethesda, MD 20814

Phone: (301) 657 3077 ext. 155 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: web.xml format

Posted by Erik Price <ep...@ptc.com>.
No, it was just a "curious" question.  Especially about the whitespace 
around the dbConnectUrl's param-value.  But I am going to just test that 
out right now myself.


Erik

Jacob Kjome wrote:
> 
> Everything should be just fine with your current setup. Are you noticing 
> problems with it?
> 
> Jake
> 
> At 01:23 PM 1/3/2003 -0500, you wrote:
> 
>> Just a simple question -- if I want to use an ampersand (or other 
>> character that is significant in XML), do I need to escape it with an 
>> entity in the web.xml ?
>>
>> For instance, is this valid:
>>
>> <context-param>
>>   <param-name>dbConnectUrl</param-name>
>>   <param-value>
>>     jdbc:mysql://localhost:3306/eprice?user=eprice&amp;password=pass
>>   </param-value>
>> </context-param>
>>
>> (Note entity used in querystring of URL.)
>>
>> Also, is okay to have the URL there on its own line, or will the 
>> whitespace before and after the URL be added to any 
>> getServletContext().getInitParameter() calls?
>>
>>
>> Thanks!
>>
>> Erik
>>
>>
>> -- 
>> 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: web.xml format

Posted by Jacob Kjome <ho...@visi.com>.
Everything should be just fine with your current setup. Are you noticing 
problems with it?

Jake

At 01:23 PM 1/3/2003 -0500, you wrote:
>Just a simple question -- if I want to use an ampersand (or other 
>character that is significant in XML), do I need to escape it with an 
>entity in the web.xml ?
>
>For instance, is this valid:
>
><context-param>
>   <param-name>dbConnectUrl</param-name>
>   <param-value>
>     jdbc:mysql://localhost:3306/eprice?user=eprice&amp;password=pass
>   </param-value>
></context-param>
>
>(Note entity used in querystring of URL.)
>
>Also, is okay to have the URL there on its own line, or will the 
>whitespace before and after the URL be added to any 
>getServletContext().getInitParameter() calls?
>
>
>Thanks!
>
>Erik
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

Re: web.xml format

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Fri, 3 Jan 2003, Erik Price wrote:

> Date: Fri, 03 Jan 2003 13:23:46 -0500
> From: Erik Price <ep...@ptc.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: web.xml format
>
> Just a simple question -- if I want to use an ampersand (or other
> character that is significant in XML), do I need to escape it with an
> entity in the web.xml ?
>
> For instance, is this valid:
>
> <context-param>
>    <param-name>dbConnectUrl</param-name>
>    <param-value>
>      jdbc:mysql://localhost:3306/eprice?user=eprice&amp;password=pass
>    </param-value>
> </context-param>
>
> (Note entity used in querystring of URL.)
>

Yes -- in fact, it's required, because otherwise you will get an XML
parsing error.

> Also, is okay to have the URL there on its own line, or will the
> whitespace before and after the URL be added to any
> getServletContext().getInitParameter() calls?
>

The container strips leading and trailing whitespace from init parameter
values before storing them, so having it on a separate line is fine.

>
> Thanks!
>
> Erik

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>