Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

getting the context root

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic