Various methods of httpservletresponse interface

Various methods of httpservletresponse interface

What are the various methods of httpservletresponse interface?

View Answers

May 23, 2012 at 3:57 PM

HttpServletResponse interface extends ServletResponse interface.
     HttpServletResponse methods?
1.addCookie: - This method is used for adding 
                 specified cookie to the response.

public void addCookie(javax.servlet.http.Cookie cookie)

2.addDateHeader: -  This method is used for adding a 
   response header with specified  name and date value.

public void addDateHeader(java.lang.String name,long date)

3.addHeader: - This method is used for adding a 
  response header with specified name and value.

 public void addHeader(java.lang.String name,
                      java.lang.String value)

4.containsHeader: - Its return type is Boolean.
  Returns true if named response is already set
  else return false.

public boolean containsHeader(java.lang.String name)

5.encodeRedirectUrl: - This method is deprecated.

  public java.lang.String encodeRedirectUrl(java.lang.String url)

6.encodeRedirectURL:- It encodes the specified URL,
   which is used by sendRedirect() method.
   If encoding is not required, returns URL as it is.

 public java.lang.String encodeRedirectURL(java.lang.String url)


7.encodeUrl: - It is deprecated.After version 2.1
  use  encodeURL in place of encodeUrl.

 public java.lang.String 
                 encodeUrl(java.lang.String url)

8. encodeURL :- If encoding is needed ,it encodes the 
 given URL by including the session ID in it 
 otherwise returns the URL unchanged.

public java.lang.String encodeURL(java.lang.String url)

9. sendError :- It is used to send an error response
    to the client. It uses specified status code and
    clear the buffer.
public void sendError(int se)

10.sendError : -It is used to send an error response
         to the client using the giver status.

public void sendError(int sc,
                      java.lang.String msg)

11.sendRedirect: - This method is used for sending                        
    redirect response to the client.It redirect to 
    the given location URL.

public void sendRedirect(java.lang.String location)

12.setDateHeader: - This method is used for setting
       a response header with specified name and date 
       value.  

 public void setDateHeader(java.lang.String name,
                          long date)

13.setHeader:-It sets a response header with the 
    given name and value.
public void setHeader(java.lang.String name,
                      java.lang.String value)

14.setIntHeader:- It sets a response header with 
    the given name and integer value.

public void setIntHeader(java.lang.String name,
                         int value)

15.setStatus: - This method is used for setting                     
              status code for response.

public void setStatus(int sc)

16.setStatus: -This method is deprecated.

public void setStatus(int sc,
                      java.lang.String sm)









Related Tutorials/Questions & Answers:
Various methods of httpservletresponse interface
Various methods of httpservletresponse interface  What are the various methods of httpservletresponse interface
Using httpservletresponse interface
Using httpservletresponse interface  How do you use httpservletresponse interface?   Example: package roseindia; import... of Httpservletresponse interface. This example shows how
Advertisements
What modifiers are allowed for methods in an Interface?
What modifiers are allowed for methods in an Interface?   Hi, What modifiers are allowed for methods in an Interface? thanks
AsyncContext Interface important methods
In this section , you will get to know about important methods of AsyncContext Interface
AsyncListener Interface important methods
In this section, you will get to know about important methods AsyncListener Interface
Identify the use and behavior of the MessageDrivenContext interface methods.
interface methods. Prev Chapter 10. Message-Driven Bean Component... of the MessageDrivenContext interface methods... interface has the following methods
Servlet Methods
Servlet Methods In this section we will read about the various methods of javax.servlet.Servlet interface. javax.servlet.Servlet interface declares some methods that are used to initialize a Servlet, handles the request received
Interface HttpServletRequest methods
Description: The interface HttpServletRequest called from the javax.servlet.http package which extends the ServletRequest interface.The HttpServletRequest... doGet(HttpServletRequest request, HttpServletResponse response) throws
Marker Interface In Java
Marker Interface In Java In this section we will read about marker interface in Java. This section will describe you the various aspects of marker interface viz. what is marker interface, use of marker interface, requirement of marker
interface
interface  develop a library interface which has drawbook(),returnbook()(with fine),checkstatus() and reservebook() methods.all the methods tagged with public
interface
interface  develop a library interface which has drawbook(),returnbook()(with fine),checkstatus() and reservebook() methods.all the methods tagged with public
methods
methods  PrintStream class has two formatting methods,what
methods
methods  PrintStream class has two formatting methods,what
methods
methods  PrintStream class has two formatting methods,what
interface
interface   Hi I have interface in that interface 3 methods are there , after some days client said that,i want to add one more method in that interface ,so how can add 4 method so that the implemented class did not affect
interface
interface  what the use of interface?   An interface is one which has abstract methods(not defined just declared)and static or non static variables.Any class can implement(inherit)the interface and make use
Httpservletresponse null pointer exception.
Httpservletresponse null pointer exception.  What is Httpservletresponse null pointer exception?   NullPointerException occurs when we try to implement an application without referencing the object and allocating
Interface in JSP
;    In interface none of its methods are implemented. All the methods are abstract. There is no code associated with an interface. In an interface all the instance methods are public and abstract. Interfaces are always
Given a list of methods for a stateful or stateless session bean class, define which of the following operations can be performed from each of those methods: SessionContext interface metho
of those methods: SessionContext interface methods, UserTransaction methods, Java Naming and Directory Interface API (JNDI API) access to java... be performed from each of those methods: SessionContext interface methods
Interface
implement(inherit)the interface and make use of the methods(functions... and implements its methods (which are declared in interface) int the class. interface Ex... for Interface in java? and want to know why they used interface instead of multiple
Caching HttpServletResponse's content.
Caching HttpServletResponse's content.  I am trying to cache the response using Filter. I have extended HttpResponseWrapper. It has issues with flushing the streams. If you hit the service for the first time, it fetches the data
interface
interface   what is the use of marking interface
interface.
interface.  Write short note on interface.   Please visit the following link: Java Interface
interface
interface  will the interface implements a interface   Hi Friend, No. Interface can extends another interface but cannot implements it, because interface will not contain the implementation. Thanks
Interface
Interface  1.Create an interface names ShapeInterface that has two methods and one constant and an abstract class named ShapeAbstract that has two... class a.Rectangle that uses the interface b.Circle that uses the interface
Interface
Interface  1.Create an interface names ShapeInterface that has two methods and one constant and an abstract class named ShapeAbstract that has two... class a.Rectangle that uses the interface b.Circle that uses the interface
INTERFACE
INTERFACE  how interface support multiple inheritance in java
interface
interface  use of interfaces,besides adding methods out of hirearchy
interface
interface  can we extend interface?   Hi Friend, Yes an interface can be extended by other interface like using extends keyword interface A{ } interface B extends A{ } For Example: interface IntefaceA { void
interface
interface  What is marker interface ?? what is its use in java programming?? is this us in programming ??Explain is implementation with code
Interface
Interface  In JDBC , where are the source code of methods which are the member of recordset and other interfaces of JDBC packege
Interface in java with example
We are going to discuss about Interface in Java. Interface is blueprint of a class. Interface is a collection of abstract methods. Interface has only... it by other interface. We can extend one or more other interfaces but cannot
interface
interface  why do we need interface in java..if it`s usefull for to obtain multiple inheritance in the sense how it gonna be achieved...and i can...)...the y we need interface...THis is question often i heard from my developer
Interface
Interface  I need to implement the interface without overriding its method and also don't use abstract class for this. How to do
interface
interface  What is the exact use of interface in real time scenario? some people says that interface provides multiple inheritance. Is it true...; Through interface, we can achieve the multiple inheritance. Java does
Interface
Interface  Declare an Interface called property containting a method compute price to compute &return the price.The inerface is to be implemented by follwaing two class (1)Bungalow&(2)Flat both the lasses have following
sendRedirect In JSP
sendRedirect In JSP          sendRedirect() method is a method of HttpServletResponse interface. When a client sends a request for a particular page
interface_querry
interface_querry  By using interface we have to implement all unimplemented methods into our class, even though we are not using all of methods, what is the alternative
Introduction to Action interface
Introduction To Struts Action Interface The Action interface contains the a single method execute(). The business logic of the action is executed within this method. This method is implemented by the derived class. For example
Java interface
Java interface  What must a class do to implement an interface?  It must provide all of the methods in the interface and identify the interface in its implements clause
Java Interface
defined inside the interface are implicitly public static final), methods signature (all the methods declared inside the interface are implicitly public... will be closed by following a semicolon. Methods inside the interface can only
Java Remote Interface
Java Remote Interface       The Remote interface identifies interfaces whose methods may be invoked... or indirectly implement this interface. Implementation classes can implement any number
Methods of HttpServlet
Methods of HttpServlet  What are methods of HttpServlet
PHP Magic Methods
Magic Methods in PHP: In PHP there are so many methods are included in recent versions, magic methods are one of them. The magic methods are listed below..._TO_REPLACE_5 __clone() In the above list of the magic methods it is very
various types of comments
various types of comments  Explain various types of comments supported by Java.   Please visit the following link: Java Comments
marked interface
marked interface  how jvm work with marked interface?(that means how it will know its behaviour with out any methods)   Hi, Learn it at Market Interface in Java tutorial page.ADS_TO_REPLACE_1 Thanks
Interface in java
Interface in java  An Interface method implemented in more than one different class with same method name. To avoid overriding of methods, we use ObjectReference for that class
Linked List Example
;  This section discusses an example to demonstrate the various methods of List interface. We are using two classes ArrayList and LinkedList... the elements of the specified collection. Iterator methods returns the values
Interface vs abstract class
Interface vs abstract class  Hai, Is there any possible to defining abstract methods in Interface
Implement the Serializable Interface
Implement the Serializable Interface  hii How many methods do u implement if implement the Serializable Interface?   hiii,ADS_TO_REPLACE_1 The Serializable interface is just a "marker" interface, with no methods

Ads