I am working on a web project that requires a Weblogic server, and the only way to view the site after it is deployed (on my Macbook Pro) is to specify the application name as a prefix for the entire site. For instance.
http:
This breaks a ton of JavaScript style and code that access resources with root URLs (e.g. / images / example.png)
While I can programmatically add "/ my-app" to content in .jsp, I cannot do this in my .css files.
I tried setting the "Default WebApp root context:" in the Weblogic console> Environment> Servers> myserver> Protocols> HTTP. But that did not work.
It seems to be so simple. In IIS, I simply add a line to my local hosts file and add the host name to my IIS container, taking a total of about 42 seconds.
127.0.0.1 myapp.local -> Let me view my site at http:
Thank you in advance for your understanding!
UPDATE !! Finally, I started to work. Some of them are very specific to my installation, but hopefully still useful to others.
To make it work, I needed to do 3 basic things and another related thing:
- Set the default server application in Weblogic
- On the local server, go to the console and log in
- Go to: Weblogic> console> Environment> Servers> myserver> Protocols> HTTP
- Set "Default WebApp Context Root:" to "/" + your application (for example, "/ myapp")
- Set the context root of the project in MyEclipse
- When opening a project in MyEclipse, right-click the project and select properties
- Expand "MyEclipse" and select "Web" and set the Web Context-root to "/"
- Set the context-root value in the weblogic.xml project file to "/"
- This file should be located in the WEB-INF folder of your project.
- Save the file and create the application
- Redeploying the application - you may need to restart the server.
Setting my local path variable to "/"
So, one more thing that I had to do was set the path variable referenced by "/". When you request a path (request.getContextPath ();), it does not add the path with "/", and if you try to use something like <c:url context="${ _path }" if the _path variable does not start with "/", it will throw an exception.
This last bit was something I came across while working with other code.
source share