Context Root with more than one /

Hi,
I am deploying a web application using tomcat and intellij.
In intellij there is an option to specify application context for the server ( in server deployment view).

When I give the context in format of /abc it works nice
But if I give the context in the format of /abc/mnv, it does not work.

Could someone suggest me a solution?

4 comments

Hello Krishna,

Just an idea: do you have Tomcat context.xml in your application? Does context
root in this descriptor the same as context root in deployment configuration?

Hi,

I am deploying a web application using tomcat and intellij.

In intellij there is an option to specify application context for the
server ( in server deployment view).

When I give the context in format of /abc it works nice But if I give
the context in the format of /abc/mnv, it does not work.

Could someone suggest me a solution?

Alexander.


0

Hello Alexander,

just today I spent several highly stressful hours trying to get that to work
with a context path like "m/cheat/sheet"
I have no context.xml in my application and according to Tomcat docs the "path"
attribute of will be ignored anyhow, unless it's a ]]> tag in
Tomcat's main server.xml

I soon gave up trying to use Idea to eliminate another source of possible errors.
I used ant and configured Tomcat manually.

Here's the solution I found:
Replace all the slashes in the context path by hashes in the name of the context
descriptor that you write to
$catalina.base/conf/Catalina/localhost

So in my case the file must be named "m#cheat#sheet.xml".

Idea incorrectly creates sub folder "m" and "cheat" and writes a file sheet.xml

Here's the link with the solution I found:
http://www.nabble.com/How-to-Deploy-WAR-using-a-sub-context-path--t4838797.html

Hope you can fix that!

Alexander Chernikov wrote:

Hello Krishna,

Just an idea: do you have Tomcat context.xml in your application? Does
context root in this descriptor the same as context root in deployment
configuration?

>> Hi,
>>
>> I am deploying a web application using tomcat and intellij.
>>
>> In intellij there is an option to specify application context for the
>> server ( in server deployment view).
>>
>> When I give the context in format of /abc it works nice But if I give
>> the context in the format of /abc/mnv, it does not work.
>>
>> Could someone suggest me a solution?
>>

Alexander.

0

Workaround: Specify "/abc#mnv" in Idea instead. Your web app will be deployed using context path "/abc/mnv".

Krishna Natarajan wrote:

Hi,
I am deploying a web application using tomcat and intellij.
In intellij there is an option to specify application context for the server ( in server deployment view).

When I give the context in format of /abc it works nice
But if I give the context in the format of /abc/mnv, it does not work.

Could someone suggest me a solution?

0

Please sign in to leave a comment.