On Fri, 3 Jan 2003, Erik Price wrote:

> Date: Fri, 03 Jan 2003 13:23:46 -0500
> From: Erik Price <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> 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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to