Thanks for the replies folks. Correct me if I am wrong, but are you both actually suggesting the same thing just in different words? Please understand this is uncharted territory for me here. While I am quite proficient in
Java (J2SE anyway) I have never used any
servlet filters before and have never really done any
J2EE stuff at all until getting my most recent job a few weeks ago. From what I am reading on google it sort of seems like I need to pull the value of the servlet being requested out of the HttpServletRequest object and check to see if it's "/login.jsp" or not. Furthermore, Bear is simply suggesting that I place the value of login.jsp into an <init-param> instead of hard-coding the
string "/login.jsp" -- is that correct or no?
So would something like this work?
It seems to me like Bear's suggestion is to add an instance variable to the class and then inside of init() I would save the value returned by config.getInitParameter() into my String instance variable (which should be "/login.jsp"). Then inside of the doFilter() method I would just have an if test comparing file and my instance variable instead of comparing it to the literal "/login.jsp" ...is that right?
In any case I'll try this out when I get back to work next week. Thanks again!