[email protected] wrote:
> Hi all,
>
> Resending the mail with formatted xml tags.
>
> Regards
> Shenaz
> ________________________________
>
> From: Shenaz Mohamed assu (WT01 - Telecom Equipment)
> Sent: Tuesday, March 17, 2009 12:49 PM
> To: '[email protected]'; '[email protected]'
> Subject: Reg: Tomcat valve
>
>
> 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.
>
>
> <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>
>
> In my project, I'm want to use the valve along with a servlet filter.
> The flow is suppose to be like this
>
> Valve -&gt; Login filter -&gt; Page servlet -&gt; 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(&quot;/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);
> }
Like Filters you need to hand over to the next Valve in the chain.
getNext().invoke(request, response);
p
> }
> }
> }[/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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]