• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Image is not displaying after Submit

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am new to struts. I have include Header.jsp page in my all jsp page(ex Login.jsp). In header.jsp page i have used <img> tag to include a bitmap image.
When Login.jsp page is accessed for the first time , Image is displayed, but when i submit with invalid name and password, the same login page is shown with validation errors. But this time the image is not shown. Instead a cross mark is displayed.

Please let me know if am missing something. Thanks in advance.
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your Header.jsp must have a relative path to the image. So when the URL changes, the relative path stops working. Lets say the <img /> tag in your Header.jsp looks like this
<img src="images/header.jpg" />
Change it to
<img src="${pageContext.request.contextPath}/images/header.jpg" />
 
reply
    Bookmark Topic Watch Topic
  • New Topic