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?
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
Joined: Mar 22, 2010
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?)
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
Joined: Mar 22, 2010
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.
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!