[nbusers] Re: Problem with images (doesnt show them)

  • From: Edson Richter < >
  • To:
  • Subject: [nbusers] Re: Problem with images (doesnt show them)
  • Date: Sun, 2 Dec 2012 07:04:56 -0200
  • Organization: Simkorp Inform├ítica Ltda

Em 01/12/2012 17:54, michat34 escreveu:
Hi when I try to put image in code and display it there is just a blank space.
<img src="/images/image.jpg">
I tried to put wrong url
<img src="/imagzs/imxge.x">
and still nothing just blank (there is even no icon which tells that url is 
incrorect if you know what i mean)
Please help do I have to import images to project to use them? and if yes - 
how?
You haven't specified which king of page are you using.
If you are running HTML, then you have to put application context (unless ROOT context) in the path. If your context is called "MyWebApp", then you should use:

<img src="/MyWebApp/images/image.jpg">

Now, if you are using JSP, you can have a "shortcut" to get automatically the context. The magic happens like:

<img src="<%= request.getContextPath()%>/images/image.jpg">

I know it's not much elegant, but it just works always (for JSP).
Similary, if you are using PHP, ASP, or other languages, you will have similar kind of method to access the context of the application (sometimes called "application name").

Regards,

Edson


[nbusers] Problem with images (doesnt show them)

michat34 12/01/2012

[nbusers] Re: Problem with images (doesnt show them)

Edson Richter 12/02/2012

[nbusers] Problem with images (doesnt show them)

michat34 12/02/2012

[nbusers] Re: Problem with images (doesnt show them)

Edson Richter 12/02/2012

[nbusers] Problem with images (doesnt show them)

michat34 12/02/2012

[nbusers] Re: Problem with images (doesnt show them)

Ion Iovu 12/03/2012

[nbusers] Re: Problem with images (doesnt show them)

Edson Richter 12/03/2012

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close