1

I want to find the extra path information of a servlet. But this information is different coded depending of the url-pattern that a customer is using. In the follow samples I want differ between case (2) and (3). Is this possible?

url-pattern: /pattern/*
===================
(1) http://localhost/context/pattern/path
ContextPath: /context
ServletPath: /pattern
PathInfo:    /path

(2) http://localhost/context/pattern
ContextPath: /context
ServletPath: /pattern
PathInfo:    null


url-pattern: /
===================
(3) http://localhost/context/path
ContextPath: /context
ServletPath: /path
PathInfo:    null

(4) http://localhost/context/
ContextPath: /context
ServletPath: /
PathInfo:    null


url-pattern: /*
===================
(5) http://localhost/context/path
ContextPath: /context
ServletPath: 
PathInfo:    /path

(6) http://localhost/context/
ContextPath: /context
ServletPath: 
PathInfo:    /
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Horcrux7
  • 23,758
  • 21
  • 98
  • 156
  • What do you mean by "find the extra path information"?. Do you have some code where you are trying to differ between your two cases? At least (2) and (3) seem different to me. – André Stannek Jan 22 '15 at 11:52
  • @AndréStannek I want the part behind the pattern. In case (3) "/path" and in case (2) null or equals. – Horcrux7 Jan 22 '15 at 12:21

0 Answers0