Re: filters in web application
This all depends on what your filters do. If each filter is creating wrappers, analysing output stream and so on, you could indeed get performances issues. Consider each filter is about 3~4 additional stack level. Also each filter = 1 object + it's configuration datas Basically a filter is do somethingcallnextfilterdosomethingelsereturn if your do sometings are trivials, there shouldn't be much performances hits, except for the fact you call lots of methode to get the job done :) Why do you need so much filters? temp temp a écrit : In a web application can I use several filters like 20 to 30 filters each of them serving some functionallity usefull for more than one '.do' .Is this a good design or there could be any performance issues when using several filters in a web application. Thanks regards - Relax. Yahoo! Mail virus scanning helps detect nasty viruses! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Filters
response.sendRedirect(url); That's what I do. You do get a reference to request, so I would assume you could get a dispatcher off it and do what you always do. I've never had a need to try it though. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Tue, March 29, 2005 12:40 pm, Denis Avdic said: Hello all, Although I've been using Struts for small projects for a while now, I haven't really used filters. Now I am incorporating some functionality from another project into mine, and the other project used plain old servlets and filters. My question is this: In filter's doFilter method, is there a way to forward to a Struts action somehow? I need to populate the session and I have all this stuff already written, I just need to do a forward to the action somehow. How could I do this without request.getRequestDispatcher() calls? Or can I do it at all? I haven't wrote pure servlet in a long long while and I forgot a lot of things so please excuse me if my question is dumb. Thanks, Denis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Filters
Frank's suggestion might work, although note that it would result in the discarding of all request parameters, which may not be what you want. If you have complex session initialization logic in an Action and you want to use it in the Filter, I'd suggest factoring it out into a utility class. Alternatively, don't try to use the filter to do this: the main reason to use a filter is to apply common logic upon every request (or at least many requests); if you have all this in an Action now, that suggests you only use it once. You could probably also somehow use the Filter to set a request attribute, and then subclass the RequestProcessor to recognize that request attribute as an instruction to invoke your session-prep action -- but that seems way more complicated than you really need. Joe At 12:45 PM -0500 3/29/05, Frank W. Zammetti wrote: response.sendRedirect(url); That's what I do. You do get a reference to request, so I would assume you could get a dispatcher off it and do what you always do. I've never had a need to try it though. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Tue, March 29, 2005 12:40 pm, Denis Avdic said: Hello all, Although I've been using Struts for small projects for a while now, I haven't really used filters. Now I am incorporating some functionality from another project into mine, and the other project used plain old servlets and filters. My question is this: In filter's doFilter method, is there a way to forward to a Struts action somehow? I need to populate the session and I have all this stuff already written, I just need to do a forward to the action somehow. How could I do this without request.getRequestDispatcher() calls? Or can I do it at all? I haven't wrote pure servlet in a long long while and I forgot a lot of things so please excuse me if my question is dumb. Thanks, Denis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Filters
Yeah, my bad... I cracked open the authorization filter I wrote because I didn't want to give a wrong answer off the top of my head... problem is, that filter just redirects to a Go away, your not allowed in here! kind of page, so there was no concern with losing request parameters in that use case. Good call Joe :) Whether he needs the contents of request of not it's a good point to be aware of. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Tue, March 29, 2005 1:24 pm, Joe Germuska said: Frank's suggestion might work, although note that it would result in the discarding of all request parameters, which may not be what you want. If you have complex session initialization logic in an Action and you want to use it in the Filter, I'd suggest factoring it out into a utility class. Alternatively, don't try to use the filter to do this: the main reason to use a filter is to apply common logic upon every request (or at least many requests); if you have all this in an Action now, that suggests you only use it once. You could probably also somehow use the Filter to set a request attribute, and then subclass the RequestProcessor to recognize that request attribute as an instruction to invoke your session-prep action -- but that seems way more complicated than you really need. Joe At 12:45 PM -0500 3/29/05, Frank W. Zammetti wrote: response.sendRedirect(url); That's what I do. You do get a reference to request, so I would assume you could get a dispatcher off it and do what you always do. I've never had a need to try it though. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Tue, March 29, 2005 12:40 pm, Denis Avdic said: Hello all, Although I've been using Struts for small projects for a while now, I haven't really used filters. Now I am incorporating some functionality from another project into mine, and the other project used plain old servlets and filters. My question is this: In filter's doFilter method, is there a way to forward to a Struts action somehow? I need to populate the session and I have all this stuff already written, I just need to do a forward to the action somehow. How could I do this without request.getRequestDispatcher() calls? Or can I do it at all? I haven't wrote pure servlet in a long long while and I forgot a lot of things so please excuse me if my question is dumb. Thanks, Denis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Filters
If your filter really wants to do a RequestDispatcher.foward() call (to go someplace other than the servlet that the original request URI is mapped to), you can do that too ... you're not stuck with redirects. That way you don't lose your request parameters and attributes. Craig On Tue, 29 Mar 2005 14:01:08 -0500 (EST), Frank W. Zammetti [EMAIL PROTECTED] wrote: Yeah, my bad... I cracked open the authorization filter I wrote because I didn't want to give a wrong answer off the top of my head... problem is, that filter just redirects to a Go away, your not allowed in here! kind of page, so there was no concern with losing request parameters in that use case. Good call Joe :) Whether he needs the contents of request of not it's a good point to be aware of. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Tue, March 29, 2005 1:24 pm, Joe Germuska said: Frank's suggestion might work, although note that it would result in the discarding of all request parameters, which may not be what you want. If you have complex session initialization logic in an Action and you want to use it in the Filter, I'd suggest factoring it out into a utility class. Alternatively, don't try to use the filter to do this: the main reason to use a filter is to apply common logic upon every request (or at least many requests); if you have all this in an Action now, that suggests you only use it once. You could probably also somehow use the Filter to set a request attribute, and then subclass the RequestProcessor to recognize that request attribute as an instruction to invoke your session-prep action -- but that seems way more complicated than you really need. Joe At 12:45 PM -0500 3/29/05, Frank W. Zammetti wrote: response.sendRedirect(url); That's what I do. You do get a reference to request, so I would assume you could get a dispatcher off it and do what you always do. I've never had a need to try it though. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Tue, March 29, 2005 12:40 pm, Denis Avdic said: Hello all, Although I've been using Struts for small projects for a while now, I haven't really used filters. Now I am incorporating some functionality from another project into mine, and the other project used plain old servlets and filters. My question is this: In filter's doFilter method, is there a way to forward to a Struts action somehow? I need to populate the session and I have all this stuff already written, I just need to do a forward to the action somehow. How could I do this without request.getRequestDispatcher() calls? Or can I do it at all? I haven't wrote pure servlet in a long long while and I forgot a lot of things so please excuse me if my question is dumb. Thanks, Denis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Filters..
I know this is an off topic but is it advisable to use Filters in a Web Application? We do routinely, to try to keep users on the approved path through the application. -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Filters..
Whoa, talk about general questions!!! :) I suppose it depends on what you want them for and the overall context... Could you be more specific? Cheers, Freddy. -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Enviado el: martes, 06 de abril de 2004 16:23 Para: [EMAIL PROTECTED] Asunto: Filters.. Hello All, I know this is an off topic but is it advisable to use Filters in a Web Application? Any kind of input wud be appreciated.. Thanks, VJ DISCLAIMER: This message contains privileged and confidential information and is intended only for the individual named.If you are not the intended recipient you should not disseminate,distribute,store,print, copy or deliver this message.Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted,corrupted,lost,destroyed,arrive late or incomplete or contain viruses.The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Filters..
VJ, Filters are a good way of extending an existing application without having to recompile or rewrite code. I often use them. [EMAIL PROTECTED] 04/06/2004 10:22 AM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:Filters.. Hello All, I know this is an off topic but is it advisable to use Filters in a Web Application? Any kind of input wud be appreciated.. Thanks, VJ DISCLAIMER: This message contains privileged and confidential information and is intended only for the individual named.If you are not the intended recipient you should not disseminate,distribute,store,print, copy or deliver this message.Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted,corrupted,lost,destroyed,arrive late or incomplete or contain viruses.The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Filters..
Apologies...for the generality of the question Our Web Application primarily consists of satellite applications interfacing with a core systemI primarily want to implement them for access checks as well as a Session Manager for each request of the application... Is there any overhead in this coz I just got an opinion that it does...how was not explained :) which led me thinking whether it really does lead to an overhead?? Next time I shall be more specific about my queries :) -Original Message- From: Freddy Villalba Arias [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 7:53 PM To: Struts Users Mailing List Subject: RE: Filters.. Whoa, talk about general questions!!! :) I suppose it depends on what you want them for and the overall context... Could you be more specific? Cheers, Freddy. -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Enviado el: martes, 06 de abril de 2004 16:23 Para: [EMAIL PROTECTED] Asunto: Filters.. Hello All, I know this is an off topic but is it advisable to use Filters in a Web Application? Any kind of input wud be appreciated.. Thanks, VJ DISCLAIMER: This message contains privileged and confidential information and is intended only for the individual named.If you are not the intended recipient you should not disseminate,distribute,store,print, copy or deliver this message.Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted,corrupted,lost,destroyed,arrive late or incomplete or contain viruses.The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] DISCLAIMER: This message contains privileged and confidential information and is intended only for the individual named.If you are not the intended recipient you should not disseminate,distribute,store,print, copy or deliver this message.Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted,corrupted,lost,destroyed,arrive late or incomplete or contain viruses.The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Filters..
Hi Vijay, I'm no guru, yet can give you my personal opinion on this matter: Yes, they have an impact. The heavier (execution time, resources consumption, etc...) the filter is, the greater the impact (and so the opposite :) ). I suppose that there is also a small overhead associated to the forwarding mechanism itself, but I haven't actually tested this. Depending on how time / resource - critical is your web app, this can become an issue or not. Yes, I believe they are of great use for certain things (mostly, global validations and general operations affecting the general behaviour of your web app) such as, for example, access control. Yet, as with any other technology, I wouldn't do a blindfold recommendation for it. I don't believe there is such thing as IT-panacea. Again, that is my humble opinion. HTH, Freddy. -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Enviado el: martes, 06 de abril de 2004 16:40 Para: [EMAIL PROTECTED] Asunto: RE: Filters.. Apologies...for the generality of the question Our Web Application primarily consists of satellite applications interfacing with a core systemI primarily want to implement them for access checks as well as a Session Manager for each request of the application... Is there any overhead in this coz I just got an opinion that it does...how was not explained :) which led me thinking whether it really does lead to an overhead?? Next time I shall be more specific about my queries :) -Original Message- From: Freddy Villalba Arias [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 7:53 PM To: Struts Users Mailing List Subject: RE: Filters.. Whoa, talk about general questions!!! :) I suppose it depends on what you want them for and the overall context... Could you be more specific? Cheers, Freddy. -Mensaje original- De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Enviado el: martes, 06 de abril de 2004 16:23 Para: [EMAIL PROTECTED] Asunto: Filters.. Hello All, I know this is an off topic but is it advisable to use Filters in a Web Application? Any kind of input wud be appreciated.. Thanks, VJ DISCLAIMER: This message contains privileged and confidential information and is intended only for the individual named.If you are not the intended recipient you should not disseminate,distribute,store,print, copy or deliver this message.Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted,corrupted,lost,destroyed,arrive late or incomplete or contain viruses.The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] DISCLAIMER: This message contains privileged and confidential information and is intended only for the individual named.If you are not the intended recipient you should not disseminate,distribute,store,print, copy or deliver this message.Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted,corrupted,lost,destroyed,arrive late or incomplete or contain viruses.The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[FRIDAY] Re: Filters..
So if you can get your webapp smoking with filters then no worries. I'm ready for friday - are we nearly there yet? - Original Message - From: Adam Hardy [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 3:37 PM Subject: Re: Filters.. I always use filters when programming. Unfiltered cigarettes are twice as likely to give you cancer. ;) On 04/06/2004 04:23 PM [EMAIL PROTECTED] wrote: VJ, Filters are a good way of extending an existing application without having to recompile or rewrite code. I often use them. [EMAIL PROTECTED] 04/06/2004 10:22 AM Please respond to Struts Users Mailing List To: [EMAIL PROTECTED] cc: Subject:Filters.. Hello All, I know this is an off topic but is it advisable to use Filters in a Web Application? Any kind of input wud be appreciated.. Thanks, VJ DISCLAIMER: This message contains privileged and confidential information and is intended only for the individual named.If you are not the intended recipient you should not disseminate,distribute,store,print, copy or deliver this message.Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted,corrupted,lost,destroyed,arrive late or incomplete or contain viruses.The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- struts 1.2 + tomcat 5.0.19 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]