File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Web application root context question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Web application root context question" Watch "Web application root context question" New topic

Web application root context question

Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
What are the rules for allowable values in the context-root element of application.xml?
I typically use it the way I suspect 99% of developers use it - its just a single token that corresponds to the war name, e.g:
and I'd get to the app features via something like:
I've run into a deployment-time situation where I need to have the servlet context correspond to a path, such as:
I've been pounding my head against WebLogic 7 trying stuff like:
and same as above, but with an initial "/":
I've yet to have any luck. Is this something that should work? In other words, am I doing something allowable but my web container doesn't correctly implement it, or am I doing something I should even be attempting?

Reid - SCJP2 (April 2002)
Serena Zhou
Ranch Hand

Joined: Dec 13, 2003
Posts: 31
May I ask if you have got the answer for this? I am facing the same problem.
Ture Hefner

Joined: Nov 14, 2004
Posts: 18
It works for me with the latest (WLS 8.1 SP3). Sorry, I don't have 7.0 installed anymore.

In the J2EE spec, it says "See the servlet spec for detailed requirements of
context root naming." In the servlet spec, I don't see much. I would probably not end it with /, from what I read.

This works fine for me in application.xml:


I access it like this:

In the end, this is probably something to take up with BEA support. The context-root in application.xml is part of the J2EE packaging, used to override the context-root in weblogic.xml (which is, of course, WLS specific), which is used to override simply using the uri minus the .war extension as the context-root.

I don't think the SCWCD exam covers J2EE app (EAR) packaging. It just covers the web app (WAR) as far as I know, so this forum probably won't be the best place to get an answer.

I agree. Here's the link:
subject: Web application root context question
It's not a secret anymore!