Solved

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

Posted on 2006-11-17
4
226 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
Comment Utility
you never closed the xml tag.
0
 

Author Comment

by:IanWood
Comment Utility
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
Comment Utility
thanks
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now