cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing resources in EAR File

Former Member
0 Kudos

We have an EAR file deployed which contains one WAR file. Inside the WAR file are image files and javascripts which are referenced in the JSPs. No matter what we try we cannot access these images or javascripts when bringing up the JSP page on the browser.

EAR file

-- WAR File

-


MainPage.jsp

-


Image1.gif__________ path - images\

-


Image2.gif__________ path - images\

-


Script1.js__________ path - js\

-


Script2.js__________ path - js\

MainPage.jsp page contains the HTML

<script src=js/Script1.js language='javascript'>

</script>

<td><IMG> src="images/Image1.gif"></td>

When accessing MainPage.jsp using http://localhost:50000/AppName/MainPage.jsp the jsp page is displayed without the images or the javascripts

We have tried every combination of directory and file name and cannot get to these resources in the EAR file. Is there something we need to do in deployment to access these resources?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

the url to your image should be:

http://localhost:50000/AppName/images/Image1.gif

Have a look under your J2EE engine installation directory for a path similar to this:

\cluster\server\services\servlet_jsp\work\jspTemp\AppName\root

As normally the server extracts the ear and war files on installation (it is not compulsory on many servers, but in most cases the extraction is the default mode).

under the root folder you should find your jsp file and a folder /images and /js and of course the corresponding files within them.

If these files are there then you might have somehow configured your web.xml file under root\WEB-INF to use some other path to the images and js, but this is unlikely.

Good Luck,

Kalle