aspose file tools
The moose likes JSP and the fly likes images folder Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "images folder" Watch "images folder" New topic
Author

images folder

saravanann shanmugam
Greenhorn

Joined: Apr 13, 2011
Posts: 4
Hello there,
Currently my application is deployed on IIS and WebSphere 5.1. and we are converting it for WebSphere 7.1
Images are deployed on IIS server and all Java components are on WebSphere.

I'm trying to configure my development box which has RAD 7.5 and WebSphere 7. My local box does not have IIS installed on.
This application is not rendering any images on my local box.

Here is the URL to JSP page. http://localhost:9080/blcri/home.jsp
The home page has images but they are not rendering. During run time, if I right click on the image, I get this url http://localhost:9080/images/main_17.gif

Question is: Where should I create this images folder?

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56157
    
  13

You could put the images folder at the context root. But more importantly, be sure your URLs to the images are server-relative, starting with the context path.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
saravanann shanmugam
Greenhorn

Joined: Apr 13, 2011
Posts: 4
Bear Bibeault wrote:You could put the images folder at the context root. But more importantly, be sure your URLs to the images are server-relative, starting with the context path.


Thanks for your response Bear Bibeault.

I do not want to change my JSP code and it has code like this.


getServletContext().getRealPath("/") is C:\Source\rationalsdp\workspace\blcri\WebContent
I have create images folder under
C:\images
C:\Source\rationalsdp\images
C:\Source\rationalsdp\workspace\images
C:\Source\rationalsdp\workspace\blcri\images
C:\Source\rationalsdp\workspace\blcri\WebContent\images

Can you please suggest me where to create the folder.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16480
    
    2

As for the images folder, you should put it where something will serve the images when it receives an HTTP request for them. But right now you don't have any such thing; Websphere isn't that thing because it only serves web applications, and your images aren't in any web application.

However it's possible to set up something which will serve those images. And you know what that something is, because you described it in your post. Let me also suggest that it's a good idea for your test environment to closely mirror your production environment. I think you should know now what I'm getting at?
blue lans
Greenhorn

Joined: Mar 23, 2011
Posts: 4
I this time is learning the JSP, thank everybody
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1002
Paul Clapham wrote: I think you should know now what I'm getting at?


No...

You can't seriously...

Surely you aren't suggesting that he .....

... install IIS?!?!?!? (cue dramatic chord: dun dun DUNNN)

Apache web server would be an alternative to IIS if you're working on a unix environment and can't install IIS.
Of course you would need a connector for it, and that can get kinda complicated.


For quicker dirtier fixes:
create a web app called "images" with its own web.xml file, and deploy that to your Weblogic server: voila: http://localhost:9080/images finds something to serve!
or
(even quicker and dirtier)
Put the images into the "default" web application (if Websphere has such a thing)

saravanann shanmugam
Greenhorn

Joined: Apr 13, 2011
Posts: 4
This is resolved by creating images application.
Thanks a lot for all who have responded to my question.
saravanann shanmugam
Greenhorn

Joined: Apr 13, 2011
Posts: 4
saravanann shanmugam wrote:This is resolved by creating images application.
Thanks a lot for all who have responded to my question.


Special thanks to Stefan Evans.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: images folder
 
Similar Threads
Error in Loading WAR file
How to start or run a application on newly created server2 on WebSphere
I need help regarding getting the URL that is "http://localhost:9080/".
Default Server port assignments in WSAD
Endpoint in WSDL