but i would like to link those images from images folder in the application directory...
for e.g. images are in folder C:/JSPproject/images and i would like to insert them in page C:\JSPproject\web\myfirstpage.jsp
So my questions are...
1) Can i create images folder in JSP project? if yes, how?
2) Can i create CSS file in JSP project? if yes, how? or was the alnernative?
3) How can i give the reference to the css file from the JSP page?
now in page1.jsp if you want to get a reference of img.png you do in the href of the image tag "images/img.png" while if you want to use the img.png in the page2.jsp you have to do "../images/img.png".
or you can start your paths with a "/" to start from the root.
Omar Al Kababji - Electrical & Computer Engineer
[SCJP - 90% - Story] [SCWCD - 94% - Story] [SCBCD - 80% - Story] | My Blog
Joined: Mar 02, 2009
Thanks for your reply.
I tried to follow as you said...here is my html code
images are in C:\JSPProject \images1\chicklet.png and ....
JSP file is in...C:\JSPProject\web\myfirstpage.jsp
I'm using Netbeans 6.5 for developing this JSP page.
Could you please tell me what im doing wrong here?
Omar Al Kababji
Joined: Jan 13, 2009
I never used Netbeans for web page development, however try to locate a folder in your project that is named WEB-INF and create a sibling folder for it and name it img. (may be the WEB-INF folder is under a folder named web). and put your image inside the folder you created which is "img".
and reference your image in the JSP using this path "img/chicklet.png"
if you don't get it then i would suggest you to better understand how is the structure of a Java web application by visiting this page