Hi all, I'm trying to implement a custom tomcat valve. My application server is JBoss 4.0.5GA with Tomcat 5.5. I created a class, "RenewSession.java" extending ValveBase.java and I declared the valve in the server.xml as follows. [tt] <Host name="localhost" autoDeploy="false" deployOnStartup="false" deployXML="false"> <Valve className="com.alcatel.ni.html.login.RenewSessionValve" /> <DefaultContext cookies="true" crossContext="true" override="true" /> </Host>[/tt]
In my project, I'm want to use the valve along with a servlet filter. The flow is suppose to be like this Valve -> Login filter -> Page servlet -> etc.. My problem is that, I'm getting the request in my Valve but it is not proceeding to the filter. Can anyone help me on this. Its really urgent. Regards Shenaz PS: Please find below my Valve code. [code]public class RenewSessionValve extends ValveBase { public void invoke(Request request, Response response) throws IOException, ServletException { if (req.getRequestURI().contains("/portal/j_security_check&quo t;)) { // step 1: save old session Session oldSession = request.getSessionInternal(true); SavedRequest saved = (SavedRequest) oldSession.getNote(Constants.FORM_REQUEST_NOTE); // step 2: invalidate old session request.getSession(true).invalidate(); request.setRequestedSessionId(null); request.clearCookies(); // step 3: create a new session and set it to the request Session newSession = request.getSessionInternal(true); request.setRequestedSessionId(newSession.getId()); // step 4: copy data pointer from the old session // to the new one if (saved != null) { newSession.setNote(Constants.FORM_REQUEST_NOTE, saved); } } } }[/code] Please do not print this email unless it is absolutely necessary. The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com