java - How can I use Weblogic (12 C) without the application context in the URL? -
i working on web project requires weblogic server , way can view site after deploying (on macbook pro) specifying application name prefix entire site. e.g.
http://localhost:7001/myapp-weblogic/ this breaks ton of styling , javascript code access resources root urls (e.g. /images/example.png)
while can programmatically add "/my-app" content in .jsp, can't in .css files.
i tried setting "default webapp context root:" in weblogic > console > environment > servers > myserver > protocols > http - did not work.
this seems should such simple thing. in iis add line local hosts file , add host name iis container - taking me grand total of 42 seconds.
127.0.0.1 myapp.local -> let's me view site @ http://myapp.local thank in advance insight!
update!! got things working. of specific setup, still helpful others.
to working needed 3 main things , 1 other related thing:
- set default application server in weblogic
- on local server, go console , log in
- go to: weblogic > console > environment > servers > myserver > protocols > http
- set "default webapp context root:" "/" + application (e.g. "/myapp")
- set context-root of project in myeclipse
- with project open in myeclipse, right-click on project , select properties
- expand "myeclipse" , choose "web" , set web context-root "/"
- set value of context-root in project weblogic.xml file "/"
- this file should located in web-inf folder of project
- save file , build app
- redeploy app - may need restart server too
setting local path variable "/"
so thing had set path variable referencing "/". when request path (request.getcontextpath(); ) not prepend path "/" , if try use <c:url context="${ _path }" if the _path variable not begin "/" throw exception.
that last bit encountered working else's code.
in application.xml specify below setting
<web> <web-uri>yourweb.war</web-uri> <context-root>/</context-root> </web> now can make call without context root as
http://localhost:7001/
Comments
Post a Comment