I think so. ALthough I haven't done it myself. You can put multiple DispatcherServlets in your web xml and map them to differrent paths. You can put the applicatiuon context as the contextCOnfig location parameter to the DispatcherServlet. SOmething like this
Try this out. I am pretty sure you can make it work
The URL pattern in the servlet mapping above is what comes after the context root, isn't it?
I don't think that's possible.
I think it's something to do with container.
For example, in WebSphere, you have to supply the context root while deploying the app using Admin Console (there may be other ways to deploy), in which case you can't provide two context roots for the same app.
Since, the OP posted this thread in Spring, I'm pretty sure he means Spring application context.. not web application context
It's confusing... I know!! This is why I call the Spring application context "Spring xml" . Spring should have named application context something else.
We can have two or more objects of application contexts.
Example:
ApplicationContext object1 =new ApplicationContext(Bean.xml);
ApplicationContext object2 =new ApplicationContext(Bean.xml);
It gets initialized twice and two application contexts are created.
Thanks for the reply:)Just confirmed your answer.
Thanks and regards,
Paritosh Chandorkar
Humans and their filthy friendship brings nothing but trouble. My only solace is this tiny ad: