This is going to be long, kindly bear with me.
My question is whether there is any easier way to achieve the following.
And my doubt is when redirection happens in default handler, jsessionid is being appended in URL automatically, why is this happening?
I have a spring MVC application deployed in
tomcat. Application is deployed as ROOT and URL is
http://<ip>:8080/
Requirement: URL should be like
http://<ip>:8080/us/en/mainapp/mobile-application
Then subsequent requests from browser should go as
http://<ip>:8080/us/en/mainapp/mobile-application/getReport
http://<ip>:8080/us/en/mainapp/mobile-application/getUserData
After creating rules in urlrewrite.xml, problem was whenever I hit
http://<ip>:8080/us/en/mainapp/mobile-application
subsequent requests from browser went like
http://<ip>:8080/us/en/mainapp/getReport (wrong)
I found that when I hit
http://<ip>:8080/us/en/mainapp/mobile-application/ ("/" appended)
subsequent requests went like
http://<ip>:8080/us/en/mainapp/mobile-application/getReport (right)
So I added a default handler in Controller and "Rule 1" in urlrewriter to pass the request first to the default handler, then appending a "/" and redirecting it to actual handler.
It did the trick, but it is not looking good. Is there any better way to so this?
And why jsessionid is being appended in URL when redirection happens in default handler, but not when request directly comes to the other handler.
I am posting relevant parts of the code below