Link to home
Start Free TrialLog in
Avatar of IanWood
IanWoodFlag for United States of America

asked on

How do i store paramaters in my web.xml file and then access from a jsp application?

Hi

I'm trying to store some paramters in my web.xml file to be accessed by a jsp app, but am having problems.

I've been trying what i've come accross omn the web, but not getting far.

I've added an env-entry to my application web.xml file (from in app-root/WEB-INF), but tomcat compalins about it and I've no idea why.

web.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app id="WebApp_1"/>
  <env-entry>
    <env-entry-name>envEntryString</env-entry-name>
    <env-entry-value>
      This is a string from the env-entry
    </env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
  </env-entry>
</web-app>

Error:-
PARSE error at lin 4, column -1
SAX parse exception
illegal character at end of document.


Any ideas?

Any really good step by step examples would be good.  I'm struggled to find much.  Well that doesn't confuse me anyway!!

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of jsev1995
jsev1995

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of IanWood

ASKER

The problem was I had a / at the end of the web-app line, but you made me check my closing tags, so the points are yours.

Cheers.
Avatar of jsev1995
jsev1995

thanks