| Author |
HttpServletRequest, getServletPath as controller
|
Jesus Angeles
Ranch Hand
Joined: Feb 26, 2005
Posts: 2036
|
|
Any one has experience where getServletPath is not useful (not reliable) in determining which path was used to connect to the servlet? Servlet 2.4 specs My code My descriptor (As you can see, I did not use /*) [ December 15, 2006: Message edited by: Jesus Angeles ] [ December 15, 2006: Message edited by: Jesus Angeles ]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56163
|
|
First and foremost, why on earth use if-then-else rather than separate servlets? What a mess! If you are trying to create a unified Front Controller, if-then-else is still not the way to go. Look into the Command pattern. Secondly, things can get complicated when dealing with includes and forwards. Is this the case? [ December 15, 2006: Message edited by: Bear Bibeault ]
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56163
|
|
|
By the way, I have no idea what the "req" in your subject is supposed to mean. Please use real words when posting.
|
 |
Jesus Angeles
Ranch Hand
Joined: Feb 26, 2005
Posts: 2036
|
|
My design (although working) may need improvement. (I have an excuse, its my first, and only 6 months into j2ee design/implement. But yes, there is no excuse for stuff blowing up in production.) But the application was installed already last week, and I am researching if that sole logic on 'control' is bullet-proof. That is: 1. The (j2ee) system will allow entry, only on those 3 servlet mapping (The class are inside web-inf, therefore are not accessible directly? ; whether server was set to allow direct or indirect component access). 2. That that method getServletPath will return those 3 exact String. (The system is on https and has authentication.)
|
 |
Jesus Angeles
Ranch Hand
Joined: Feb 26, 2005
Posts: 2036
|
|
I might have used some sort of pattern, but I did not intend to do so. My design was simply brought by a huge logic that I could have broken down to methods or classes. (I edited the title, for the 'req') [ December 15, 2006: Message edited by: Jesus Angeles ]
|
 |
 |
|
|
subject: HttpServletRequest, getServletPath as controller
|
|
|