Solved

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

Posted on 2006-11-17
4
229 Views
Last Modified: 2008-03-06
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.
0
Comment
Question by:IanWood
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
jsev1995 earned 200 total points
ID: 17972258
you never closed the xml tag.
0
 

Author Comment

by:IanWood
ID: 17986058
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.
0
 
LVL 3

Expert Comment

by:jsev1995
ID: 17986684
thanks
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This video teaches users how to migrate an existing Wordpress website to a new domain.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question