aspose file tools*
The moose likes BEA/Weblogic and the fly likes Link to file outside context root of weblogic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Link to file outside context root of weblogic" Watch "Link to file outside context root of weblogic" New topic
Author

Link to file outside context root of weblogic

khue vu
Greenhorn

Joined: Mar 22, 2010
Posts: 6
Hi, If I want to display an image. Its src is a file outside context root. But when I test the web page, nothing displayed
How can I config weblogic server to do that?
Thanks a lot.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Post some code and explain in more detail what you are trying to do


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
khue vu
Greenhorn

Joined: Mar 22, 2010
Posts: 6
Hi,

I am trying to display an image in a web page by <img src=... /> but the image is outside the context root. Thus, it can't be displayed.
I want to ask if I can config weblogic to display the image? Or is there any way to run around this problem?
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

You can use a web server like Apache to serve the image or write a servlet that will stream the image to the user
khue vu
Greenhorn

Joined: Mar 22, 2010
Posts: 6
Hi Deepak, Can you explain a bit more?
That means I can't do it with Weblogic ?
If I use a servlet, will I be able to stream a video or music file as the size is much larger?

Thanks a lot.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

Elaborate on your requirement a little more. Why are you trying to use weblogic and what are you trying to do ? What you want can be achieved through a web server. At least that is what it looks like
khue vu
Greenhorn

Joined: Mar 22, 2010
Posts: 6
I am using Weblogic as part of the Oracle FusionMiddleware.
To be more specific, on my server's harddisk, there will be media files which are not inside the context root. My web app will enable the client to play these files.
Thus my web app must be able to play media files which are outside the context root. Is there anyway to do it? (You need any more info?)
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

The perhaps what you are looking at is using a HTML page and a tool like this one -> http://www.longtailvideo.com/players/jw-flv-player/
Matt Cartwright
Ranch Hand

Joined: Aug 25, 2008
Posts: 149


you are trying to access a file which is not bundled with
your Web application.

This feature has been discontinued in WebLogic Server version 6.x.

You could bundle the file with your Web app and use a resource loader.

Have a look at $WLS_HOME/samples/server/examples/src/examples/common/thirdparty/GenericResourceLoader.java

Make it %WLS_HOME% on Windows.

Hope that helps
Matt
khue vu
Greenhorn

Joined: Mar 22, 2010
Posts: 6
Thanks Matt

Your suggestion is two different methods right?
- Either set the context root as the whole window Or use a ResourceLoader to load the resource (but why you mean I still need to bundle the file with the app?

I have one question regarding to ResourceLoader. I concern about the performance of app. At run time, the loader class will send the resource to the client directly or it will load the resource to the server (when retrieve the resource using getProperties) then send to the client? As my files are movie files, they are large.


Matt Cartwright
Ranch Hand

Joined: Aug 25, 2008
Posts: 149

khue vu wrote:As my files are movie files, they are large.


First you were talking <img src=... /> now it is movies?
That dog won't hunt.

The HTML tag IMG displays images only.


and back to the Weblogic stuff, no, I am saying:
You cannot reference anything in your Web-app
that is not within the scope of your Web-app.
To get it into the scope, you have to bundle it
within your WAR file.

In general, you really should consider hosting your
static content on an external HTTP server (e.g. Apache)
to not block your WebLogic resources with movie downloads!

Hope that helps
M
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Link to file outside context root of weblogic