File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes getting the context root Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Reply Bookmark "getting the context root" Watch "getting the context root" New topic
Author

getting the context root

deep venu
Ranch Hand

Joined: Jun 09, 2001
Posts: 56
HI,
there is a context-root tag in our application xml when we make a ear .
what i need to do is to take this context root into my jsp and servlets so that if atall one makes a mistake in the application.xml while giving the context root the jsps, servlets or any webApp component can still trace each other..
~Dee
Joe McGuire
Ranch Hand

Joined: Mar 19, 2001
Posts: 293
Deep,
I found some info in the BEA docs that may give the answer to what you're trying to do.
If you deploy a Web Application as part of an Enterprise Application, you can specify a string that is used in place of the actual name of the Web Application when WebLogic Server resolves a request for the Web Application. You specify the new name with the <context-root> element in the application.xml deployment descriptor for the Enterprise Application.
For example, for a Web Application called oranges.war, you would typically request a resource from the oranges Web Application with a URL such as:
    http://localhost:7001/oranges/catalog.jsp
    If the oranges Web Application is packaged in an Enterprise Application, you can specify a value for the <context-root>, such as "fruit," shown in the following example:

      <module>
      <web>
      <web-uri>oranges.war</web-uri>
      <context-root>fruit</context-root>
      </web>
      </module>

      You would then use the following URL, using the new context "fruit," to access the same resource from the oranges Web Application:
deep venu
Ranch Hand

Joined: Jun 09, 2001
Posts: 56
HI Joe,
thanx..thats exactly what i have done but then on i stumbled onto another problem. MAy be not related to this forum.
Whats happening is say take ur example of fruit being the context root. what i do is write the uri in my index.html as /fruit/jsp/Login.jsp. so when i type http://localhost:9001/fruit the login.jsp is called. Then when the user presses on the ok button the submission is made to the login servlet which (after whatever validations reqd. ) forwards the request to a Main.jsp using requestDispatcher("/fruit/jsp/Main.jsp") but when i do this it gives a weird display "HTTP POST mathod not supported by this url"...i have no idea why?? but if use "/jsp/Main.jsp" it works fine...
 
 
subject: getting the context root
 
Threads others viewed
WSAD CHKJ3017E: invalid Context Root
URGENT HELP IN WEBSPHERE4.0
web group not found
getting the context root
Error using forward method
MyEclipse, The Clear Choice