GeeCON Prague 2014*
The moose likes JSP and the fly likes images folder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
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: 61315
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by 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: 18570
    
    8

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: 1018
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://aspose.com/file-tools
 
subject: images folder