what are filters in java servlets

Ads
 

what are filters in java servlets

what are filters in java

View Answers

May 7, 2012 at 4:25 PM

Filters are powerful tools in servlet environment. Filters add certain functionality to the servlets apart from processing request and response paradigm of servlet processing. Filters manipulate the request and response in a web application, and they can be applied to any resources like HTML, graphics, a JSP page which are served by the servlet engine. Authentication of data, format conversion of data and redirecting the page to another page are certain useful functions of filters.

A filter is configured in a web.xml file. The class using the filters should extend javax.servlet.Filter. Every request in a web application, the servlet container decides the filters to apply and adds them to the filter chain, in the order they appear in web.xml file. A filter also has life cycle mechanisms init(),doFilter() and destroy().


July 24, 2012 at 9:44 AM

off course wew have several mechanisms for that like redirecting page to another page (request dispatcher). all these functionalities can be implemented in controller itself then why we are going for filters

Ads









Related Tutorials/Questions & Answers:
What is Java Servlets?
What is Java Servlets?      ... enabled web server. Servlets run entirely inside the Java Virtual Machine. Since.... Servlets can access the entire family of Java APIs, including the JDBC API
servlets
what are filters in java servlets  what are filters in java   Filters are powerful tools in servlet environment. Filters add certain functionality to the servlets apart from processing request and response paradigm
Advertisements
java servlets
java servlets  please help... how to connect java servlets with mysql i am using apache tomcat 5.5
Java Servlets
Java Servlets  If the binary data is posted by both doGet and doPost then which one is efficient?Please give me some example by using both doGet and doPost. Thanks in Advance   The doPost method is more efficient
servlets
servlets  what is the duties of response object in servlets
servlets
what are advantages of servlets  what are advantages of servlets   Please visit the following link: Advantages Of Servlets
What is Java?
What is the use of Java
java servlets with database interaction
java servlets with database interaction  hai friends i am doing a web application in that i have a registration page, after successfully registered... "not enough values" can you please assist how to get rid of this problem what problem
Filters
Filters  Where we use Filters in the project? give one example code, how to use Filters to provide security for the application
servlets
what is the architecture of a servlets package  what is the architecture of a servlets package   The javax.servlet package provides interfaces and classes for writing servlets. The Servlet Interface The central
java servlets - JSP-Servlet
java servlets  how to get the parameter value of input type file using java servlets  Hi, You can use request.getParameter(). In Jsp, --- --- IN servlet, String fileName=request.getParameter('fl'); If you
making use java image filters
making use java image filters  while making use any functions built in jerry's filter in java application i get a NullPointerException.. I dont know the reason for this.. please give me a solution
what is oops in java
what is oops in java  what is oops in java
what is oops in java
what is oops in java  what is oops in java
servlets
servlets  why we require wrappers in servlets? what are its uses? Please explain   These wrappers classes help you to modify request...://www.roseindia.net/servlets/response-filte.shtml
Introduction to Java Servlets
Introduction to Java Servlets       Java Servlets are server side Java programs that require... associated information required for creating and executing Java Servlets
servlets
servlets why do we need web-inf directory in web application  why do we need web-inf directory in web application? means what's the benefits of doing so
Servlets
Servlets  Java Servlet technology  You have set.... Anyways, please visit the following links: http://www.roseindia.net/servlets/introductiontoconfigrationservlet.shtml http://www.roseindia.net/servlets
servlets
servlets   Hi what is pre initialized servlets, how can we achives?   When servlet container is loaded, all the servlets defined in the web.xml file does not initialized by default. But the container receives
servlets
what are sessions in servlets  what are sessions in servlets   A Session refers to all the request that a single client makes to a server...: http://roseindia.net/jsp/jspsession/ http://www.roseindia.net/servlets
What is the latest version of Java?
What is the latest version of Java?  Hi, What is the latest version of java as of now? Thanks
What is review of Hibernate in Java?
What is review of Hibernate in Java?  Hi, Is Hibernate really popular? What is review of Hibernate in Java? Thanks
What is review of Hibernate in Java?
What is review of Hibernate in Java?  Hi, Is Hibernate really popular? What is review of Hibernate in Java? Thanks
What is review of Hibernate in Java?
What is review of Hibernate in Java?  Hi, Is Hibernate really popular? What is review of Hibernate in Java? Thanks
What is JSS in Java?
What is JSS in Java?  Hi, Please let me know what is JSS in Java Technology ,what is the use of it? Need study material on the same
the servlets
what is diff between generic servlets and httpservlets  what is diff between generic servlets and httpservlets   Difference between GenericServlet and HTTPServlet: 1)GenericServlet belongs to javax.servlet package
servlets
what are cookies in servlets  what are cookies   Cookies... regarding the user usage and habits. Servlets sends cookies to the browser client...://www.roseindia.net/jsp/jspcookies.shtml http://www.roseindia.net/servlets/use
how to convert java fram to java servlets
how to convert java fram to java servlets   hi every java master or java professional can you teach me how to convert JFram to Java Servlets program...","Find What?",JOptionPane.PLAIN_MESSAGE); ResultSet rs
what is the difference in java and j2ee
what is the difference in java and j2ee  Hi, Please tell me: 1. What is the difference between Java and Core Java and 2. Difference between Java and J2EE
What is the latest version of Java?
What is the latest version of Java?  Hi, What is the latest version of java as of now? Thanks   Hi, the latest version of Java is JDK 1.8. or simply Java 8. thanks
What is the use of Java?
What is the use of Java?  Hi, What is the use of Java programming Language? How Java is useful for creating applications? Thanks   Java.... You can check more details at What is the use of java?. Thanks

Ads