Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8087977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:57:03+00:00 2026-06-05T18:57:03+00:00

I’m fairly new to servlets so I hope this isn’t an obvious question. So

  • 0

I’m fairly new to servlets so I hope this isn’t an obvious question. So I have a simple Java servlet I’ve created in NetBeans using a template. I have a context parameter I created in web.xml that lists allowed hosts (one of my request parameters is a URL which I’ll compare against this list):

<context-param>
    <param-name>allowedHosts</param-name>
    <param-value>
        http://opendap.co-ops.nos.noaa.gov/thredds/wms/NOAA/CBOFS/MODELS/201206/nos.cbofs.fields.nowcast.20120612.t00z.nc?service=WMS&version=1.3.0&request=GetCapabilities
        http://www.google.com
        http://www.facebook.com
    </param-value>
</context-param>

When I put only dummy URLs in like Google and Facebook, this works perfectly. However, when I add the first URL, the Tomcat server cannot even deploy. Looking at my logs, I see this at the top of a very long stacktrace:

SEVERE: Parse Fatal Error at line 19 column 146: The reference to entity "version" must end with the ';' delimiter.
org.xml.sax.SAXParseException: The reference to entity "version" must end with the ';' delimiter.

Line 19 column 146 indeed points to the “version” portion of that long URL I have in the list of context parameters. So obviously “version” is some kind of reserve word. If I remove the “version” parameter from this URL, “request” is also a problem.

I can get around this by doing just http://opendap.co-ops.nos.noaa.gov/thredds/wms/ as the URL (because ultimately I want a list of hosts not specific URLs anyway), but I was wondering what one would have to do to get around this otherwise… Is there a way to include URLs that have such “reserve words” in web.xml?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T18:57:12+00:00Added an answer on June 5, 2026 at 6:57 pm

    Just put “&amp;” (without the quotes) instead of the ampersands in your URL.

    Hope this helps – DF

    Edit: Try this:

    <context-param>
    <param-name>allowedHosts</param-name>
    <param-value>
        http://opendap.co-ops.nos.noaa.gov/thredds/wms/NOAA/CBOFS/MODELS/201206/nos.cbofs.fields.nowcast.20120612.t00z.nc?service=WMS&version=1.3.0&request=GetCapabilities
    </param-value>
    

    Edit2: PS These things are called “entities” in XML – do a Google for more info

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have thousands of HTML files to process using Groovy/Java and I need to
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.