Solved

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

Posted on 2006-11-17
4
233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

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

Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

623 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