tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: web.xml format
Date Fri, 03 Jan 2003 19:55:30 GMT


On Fri, 3 Jan 2003, Erik Price wrote:

> Date: Fri, 03 Jan 2003 13:23:46 -0500
> From: Erik Price <eprice@ptc.com>
> Reply-To: Tomcat Users List <tomcat-user@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:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message