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:

  1. set default application server in weblogic
    1. on local server, go console , log in
    2. go to: weblogic > console > environment > servers > myserver > protocols > http
    3. set "default webapp context root:" "/" + application (e.g. "/myapp")
  2. set context-root of project in myeclipse
    1. with project open in myeclipse, right-click on project , select properties
    2. expand "myeclipse" , choose "web" , set web context-root "/"
  3. set value of context-root in project weblogic.xml file "/"
    1. this file should located in web-inf folder of project
    2. save file , build app
    3. 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

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -