Question: Various methods of httpservletresponse interface

Ads

 
 
 

Share on Google+Share on Google+

ratna rathor
Various methods of httpservletresponse interface
1 Answer(s)      4 years and 11 months ago
Posted in : JSP-Servlet

What are the various methods of httpservletresponse interface?

Ads
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)

Ads









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
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
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 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
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
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
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... instead of marker interface. Java annotation is introduced with its various
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
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
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
interface
interface   what is the use of marking interface
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.
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  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  use of interfaces,besides adding methods out of hirearchy
interface
interface  What is marker interface ?? what is its use in java programming?? is this us in programming ??Explain is implementation with code
Tutorials   
Java Spring Hibernate Struts Training fat image from db fat image from db fat image from db fat image from db unable to get value returned from javascript variable in page How to change image size before adding to mysql using jsp Design a registration.jsp page with input for user registration details Cart Quantity jsp servlet coding issue servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? image pdf marking pdf marking Multiple image upload using JSP Read code from excel sheet and upload into database using JSP Student java about search engine Convert BLOB to PDF and save it to a location how to copy files from remote to local machine using SFTP SSL in java? Like Team viewer Socket and Servert -Jsp how to copy files from remote location to local using java? How To Store Multilple Images In MySQL database dynamically with image uploader and then retrieve them in image gallery using java how to create SOAP based web service in java? how to fetch data from mysql database table and draw a bar chart on that data using in jsp how to create users in LDAP using java? how to authenticate user using TIVOLI api in java? how to create users using IBM Tivoi API in jsp/servelet? Java/J2ee Please explain this code as many packages and classes are unknown to me .! how to download the uploaded folder files using jsp Login Query image is display from path of mysql database please reply the code to store dynamic fields in database? Reloading issue in jsp How to get Button Id ? calling one jap page from another jsp page login login Problem to get connection from DAO class to JDBC Page Loading Time Fix table's column's name row(1st row of the table) so that it does not move up when the table is scrolled up to view more rows below Sending hidden values

Ads

 
Advertisement null

Ads