0

Here i am new to spring so i have following problems,

I have to show a image on my Home Page of jsp.

I have used img in jsp as,

<img src="WebContent/images/SSAgroLOGO.gif" /> 

My Directory Structure is as,

  • My App
    • WebContent
      • images
        • SSAgroLOGO.gif
      • WEB-INF
        • jsp
          • HomePage.jsp

It not showing the image on Page...

So Please Help me,

Thanks in advance...

5
  • you do not need WebContent/. images/SSAgroLOGO.gif should be fine Commented Feb 27, 2014 at 6:57
  • No!!!Sir it's not working ....Should i add something in spring-servlet.xml or in web.xml...Please help me!!! Commented Feb 27, 2014 at 7:14
  • I have also tried as <img src="images/SSAgroLOGO.gif" alt="SSAgroLOGO" height="42" width="42"/> But not Done... Commented Feb 27, 2014 at 7:15
  • check to make sure that the file is deployed to your web server and that the case is correct Commented Feb 27, 2014 at 7:19
  • I am using Eclipse for developing and Apache Tomcat 7.......is that ok.... Commented Feb 27, 2014 at 7:23

1 Answer 1

4

Try this -

<img src="images/SSAgroLOGO.gif" /> 

WebContent would be working directory for web-apps. A sample war folder structure visualization -

enter image description here

and in addition to set other attributes(ex. alt, hieght and others) - Check Here

Sign up to request clarification or add additional context in comments.

5 Comments

This could be a comment rather . please clearly explain about the directory listings also
yap, my clarification added
No!!!Sir it's not working ....Should i add something in spring-servlet.xml or in web.xml...Please help me!!!
I have also tried as <img src="images/SSAgroLOGO.gif" alt="SSAgroLOGO" height="42" width="42"/> But not Done...
It should work as you follows the folder structure, I really cann't see error exactly while loading the image

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.