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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:20:08+00:00 2026-06-14T06:20:08+00:00

I have Java web app with following structure WebContent->images->image.jpg ->js->test.js I tried displaying an

  • 0

I have Java web app with following structure

WebContent->images->image.jpg
          ->js->test.js

I tried displaying an image in my jsp with the following code.

<img src="${pageContext.request.contextPath}/images/image.jpg" width="500" height="500" />

Firebug shows a GET request with the below URL

 http://localhost:8080/test/images/image.jpg

With a 200 ok response, but displays nothing.

I checked these questions:

Unable to load static contents (Images/JS) in web-application

Browser can't access/find relative resources like CSS, images and links when calling a Servlet which forwards to a JSP

But didn’t help. Is there anything wrong with what I am doing?

My servlet mapping

<servlet>
<servlet-name>test</servlet-name>
<servlet-class>com.test.HomeServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
  • 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-14T06:20:09+00:00Added an answer on June 14, 2026 at 6:20 am

    The issue is that your servlet is catching all the request and passing it to the HelloServlet.

    You need to avoid giving “<url-pattern>/</url-pattern>“.

    try changing the url-pattern to “<url-pattern>/test</url-pattern>“

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

Sidebar

Related Questions

I have a web application with a following structure: src + main +-+ java
I have following code in web aplication java.​awt.Desktop.getDesktop().print(new File(path)); It is working with any
I am getting an error for the following code in a java web app--
I have a Java web app running on Tomcat 7 that is using JDBC
I have a scenario in a java web app, where a random hexadecimal value
Hello I am a Java web app developer I have a problem, I would
I have a web-app with a Java back-end that uses Tomcat jdbc-pool for database
I have a web app built on Java Servlet technology. I am thinking of
We have a Java EE-based web application running on a Glassfish app server cluster.
Background: I have created a CRUD web app using a java based RAD tool

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.