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 7085831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:28:25+00:00 2026-05-28T07:28:25+00:00

I’m maintaining a legacy Java servlet webapp ( nwp ). My goal is to

  • 0

I’m maintaining a legacy Java servlet webapp ( nwp ). My goal is to learn Spring and gradually update the webapp to use Spring as much as possible.

The servlet webapp, nwp, now runs on WebLogic 9.2. It is packaged and deployed as nwp.war. Every HTTP Request gets submitted to a unique servlet, which process the request and prints out a web page/screen. Each servlet will read in various resource files from a remote location outside of nwp.war to use for headers, footers, etc.

Yes, it is primative, which is why I want to update it. It also made sense to have the “include files” in a remote location outside of the war as 3 applications use those files. However, as part of updating the nwp app I plan on consolidating the other two ( similarly primative ) apps into just the nwp. Eventually.

As a first step in converting this application to Spring I have rearranged the directory tree to have these subdirectories under the WEB-INF dir:

  • images
  • js
  • css

The servlet generated HTML references images as
“

My problem is that right now the servlet generated HTML can not find images in the WEB-INF/images directory inside of the nwp.war.

Right now, the nwp.war file contains a file called weblogic.xml to map the URLs for images to where they sit on the server:

<wls:virtual-directory-mapping>
        <wls:local-path>/common/resources/images</wls:local-path>
        <wls:url-pattern>/images/*</wls:url-pattern>
        <wls:url-pattern>*.jpg</wls:url-pattern> 
        <wls:url-pattern>*.gif</wls:url-pattern> 
</wls:virtual-directory-mapping>

I’m new to WebLogic and WebLogic 9.2.

I’ve tried changing that mapping in a number of was so that the servlet generated HTML will look for the pictures in the WEB-INF/images directory inside of the war.

Is this (servlet generated html finding images ) even possible or am I going to have to use the current system of getting images until I can convert the servlets into JSPs?

Thanks

Steve

  • 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-05-28T07:28:26+00:00Added an answer on May 28, 2026 at 7:28 am

    The HTML won’t be able to directly reference images inside the WEB-INF folder. This is for security. So you have 2 options:

    1. Move the images so that they’re directly under / rather than /WEB-INF/
    2. Create another servlet to serve those images

    If you decide to use a servlet, you can use ServletContext getResourceAsStream to access images from the /WEB-INF/images directory. For example:

    servletContext.getResourceAsStream("/WEB-INF/images/test.jpg");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have thousands of HTML files to process using Groovy/Java and I need to
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

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.