wood burning stoves*
The moose likes Servlets and the fly likes context conflict Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "context conflict" Watch "context conflict" New topic
Author

context conflict

Esteban Puertas
Greenhorn

Joined: Mar 23, 2008
Posts: 22
Hi,
Can someone tell me please what happens if I have two web modules with conflicting contexts within the same application ?
web module A with a context "/"
web module B with a context "/app2"

A request like /app2/index.htm will be handled by module A or B ?

Thanks
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Originally posted by Esteban Puertas:
Hi,
Can someone tell me please what happens if I have two web modules with conflicting contexts within the same application ?
web module A with a context "/"
web module B with a context "/app2"

A request like /app2/index.htm will be handled by module A or B ?

Thanks


What you have described above is not conflicting , as long as the context roots of the two web applications are different there should be no problem. So, Module B should happily deal with the request.
[ July 29, 2008: Message edited by: Martijn Verburg ]

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60737
    
  65

What do you think will happen? When you tested it out, were you correct?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

web module A with a context "/"
web module B with a context "/app2"


From the above it looks like module B is a part of module A, isn't it?
So there wont be any conflict at all.

If they are different, then why dont you use /app1 and /app2.


Hope this helps


SCJP, SCWCD.
|Asking Good Questions|
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60737
    
  65

Originally posted by Amit Ghorpade:
From the above it looks like module B is a part of module A, isn't it?
No. One is the root context, and one is not.
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

I get it now, but its still confusing
with the /, I can access /app1/foo.html isn't it?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60737
    
  65

Yes, which is why the OP has asked his question. As this is such an easy thing to test, I'm still waiting to hear what he discovered.
M Kilby
Greenhorn

Joined: Jul 30, 2008
Posts: 7
Doesn't the ROOT application help itself to the 'empty' context? I.e. opening http://myserver:myport/ will map to the application installed at webapps/ROOT.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60737
    
  65

"m a k", please check your private messages for an important administrative matter.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: context conflict
 
Similar Threads
Sending data between two webapps
Dependency between wars
Problem of EJB module deploy & access
How to integrate two web applications having two different context paths
jboss web application (WAR) deployment