Hi P,

It worked. I really appreciate your help.

Thanks a lot!!

Regards
Shenaz

-----Original Message-----
From: Pid [mailto:p...@pidster.com]
Sent: Tuesday, March 17, 2009 4:38 PM
To: Tomcat Users List
Subject: Re: FW: Reg: Tomcat valve

shenaz.a...@wipro.com wrote:
> Hi Pid,
>
> I don't have a second valve. Once my request is processed in
> RenewSessionValve, i want it to be available in my login filter. Even
> if I'm using another valve, how I will eventually get the request in
> login servlet?

Doesn't matter whether you're using another Valve or not.  Unless your
Valve performs some kind of redirection, it needs to call invoke() on
the next Valve.  Yours is just one of several Valves.

Tomcat handles the end of the chain and passes the request/response into
the appropriate web application Filter chain and then to the matching
Servlet.

p


P.S. No need to double reply, if you reply to the list, I'll get it.



> Regards
> Shenaz
>
> -----Original Message-----
> From: Pid [mailto:p...@pidster.com]
> Sent: Tuesday, March 17, 2009 4:20 PM
> To: Tomcat Users List
> Subject: Re: FW: Reg: Tomcat valve
>
> shenaz.a...@wipro.com 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: 'users@tomcat.apache.org'; 'users-h...@tomcat.apache.org'
>> 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 -&amp;gt; Login filter -&amp;gt; Page servlet -&amp;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(&amp;quot;/portal/j_security_check&amp;
>> q
>> uo
>> 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: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
> 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: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


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: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to