Java Servlet Filters are very powerful and have been around for a while and they are used for intercepting the requests and responses dynamically and can transform\modify response for different devices. The WCS framework allows programmers to extend this feature and use if solve various interesting problems.
I have to warn that servlet filter should only be used very carefully as every request/response goes through it and if not done right could impact the performance of the site.
There are 3 parts to writing a filter in commerce.
1. Defining the Filter in web.xml (Web Deployment descriptor)
<filter>
<display-name>XXBlockServletFilter</display-name>
<filter-name>XXBlockServletFilter</filter-name>
<filter-class>com.company.webcontroller.XXBlockServletFilter</filter-class>
<init-param>
<param-name>listOfParams</param-name>
<param-value>Param1,Param2,Param3</param-value>
</init-param>
</filter>
2. Where to add filter mapping in web.xml The order of filter mapping specified in the web deployment descriptor is used for filter chaining. I have worked on a couple and have them before DynaCache filter and the rational behind that is, we wanted to intercept the request before it goes into the DynaCache filter.
All requests in commerce are processed through multiple filters. It is important to understand where you want to place the filter.
3. Writing the java code for XXBlockServletFilter by overriding the doFilter method: All the processing happens here so if you are using it for Mobile or XML for any ruby on rails front end or blocking certain kinds of commands.
For More information on Commerce flow of request:
http://publib.boulder.ibm.com/infocenter/wchelp/v7r0m0/topic/com.ibm.commerce.developer.doc/concepts/csdrequestsummary.htm
Hi,
ReplyDeleteWhere is web.xml file on production environment ?
Excellent post!!! Java is most popular and efficient programming language available in the market today. It helps developers to create stunning desktop/web applications loaded with stunning functionalities. J2EE Training in Chennai | JAVA Training in Chennai
ReplyDeleteDear admin, The way you have explained the concept is mezmerizing. Thank you so much for sharing tis worth able content with us. The concept taken here will be useful for my future programs and i will surely implement them in my study. Keep blogging article like this.
ReplyDeleteJAVA Training in Chennai | Best JAVA Training in Chennai | Salesforce training in chennai
thanks for sharing this post
ReplyDeleteBest Selenium Training in Chennai | Android Training in Chennai | Java Training in chennai | Webdesigning Training in Chennai
nice post
ReplyDeleteselenium training in chennai | selenium training institute in chennai | Android training in chennai | android training institute in chennai
keep posting
ReplyDeleteBest Selenium Training in Chennai | Android Training in Chennai | Java Training in chennai | Webdesigning Training in Chennai
Nice blog to read
ReplyDeleteBest Selenium Training in Chennai |Selenium Training in Chennai |
Android Training in ChennaiBest Manual Testing Training in chennai
nice one
ReplyDeleteselenium training in chennai | selenium training institute in chennai | Android training in chennai | android training institute in chennai
interesting to read
ReplyDeleteselenium training in chennai | selenium training institute in chennai | Android training in chennai | android training institute in chennai
Thank you for sharing
ReplyDeleteBest Selenium Training in Chennai |Selenium Training in Chennai |
Android Training in ChennaiBest Manual Testing Training in chennai
Nice Blog to readAndroid Training in ChennaiBest Android Training in ChennaiAndroid Training Institute in Chennai
ReplyDeleteExcellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
ReplyDeletesalesforce training in chennai | salesforce training institute in chennai
Thanks for sharing this informative content which provided me the required information about the latest technology.
ReplyDeleteSalesforce training in Chennai | Salesforce course in Chennai
I have read your blog its very attractive and impressive. I like it your blog.
ReplyDeleteJava Training in Chennai Core Java Training in Chennai Core Java Training in Chennai
Java Online Training Java Online Training Core Java 8 Training in Chennai Core java 8 online training JavaEE Training in Chennai Java EE Training in Chennai
Thank you for this valuable information. I have got some important suggestions from it. I'm working in Brave Technologies Private Limited. We provides lowest price of ERP Software for our clients. Contact us on info@bravetechnologies.in.ERP software Chennai
ReplyDeleteThe best thing is that your blog really informative thanks for your great information!
ReplyDeleteerp providers in chennai
Thanks for the sharing this post.
ReplyDeleteSD Training in Gurgaon | SAP HCM training institute in Gurgaon
I have read your Blog, its really amazing..Thanks for sharing...
ReplyDeleteAndroid Training Institute in Chennai | No.1 Android Training in Chennai
Thanks For Your valuable posting, it was very informative
ReplyDeleteWebdesign Lüdenscheid
Managing relationships with multiple providers and carriers should be simplified by using this system. The administrator should have the ability to control and process fulfillment of orders and the relevant information should be maintained by the system for later review and assessment. visit this site
ReplyDeleteThe website is looking bit flashy and it catches the visitors eyes. A design is pretty simple .
ReplyDeleteoffice 2010 professional plus key deutsch
Thanks For Your valuable posting, it was very informative
ReplyDeleteInternet Marketing Dienstleistungen
Nice post. I have been reading a lot of stuff on this topic in the last few months, but this article stands out with its simplicity & authenticity. Every passage made profound sense. Thanks a lot for this.
ReplyDeleteME/M.Tech Project Center in Chennai | ME/M.Tech Project Center in Velachery
Great and Useful article..thanks for sharing your excellent post.
ReplyDeletePower System Project Center in Chennai | Power System Project Center in Velachery
Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.
ReplyDeletewhite label website builder
mobile website builder
amazing
ReplyDeletepersonalrekrutierung,
Great post. Wonderful information and really very much useful. Thanks for sharing and keep updating.
ReplyDeletejava training in chennai
java course in chennai
Great Article
ReplyDeleteProject Centers in Chennai
Final Year Project Domains for CSE
JavaScript Training in Chennai
JavaScript Training in Chennai
Get the best Economics Assignment Help online at essaycorp.com.au. 100 % Trusted & Secure. We offer economics assignment & homework help On-time Delivery and Affordable Price.
ReplyDeleteEconomics Assignment Help