Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.
Reading init param
By
Sana mateen
ServletConfig interface
• What is the need?
• Sometimes we may have a requirement that a value keeps changing time
to time...
HTTP STATUS CODES
• The Status-Code element in a server response, is a 3-digit integer where
the first digit of the Status...
Methods to set HTTP status code
• public void setStatus ( int statusCode )
• public void sendRedirect(String url)
• public...
Reading init param
Reading init param
Reading init param
Reading init param
Reading init param
Reading init param
Reading init param
Reading init param
Reading init param
Reading init param
Reading init param
Próxima SlideShare
Cargando en…5
×

Reading init param

How do you read init parameters from web.xml and importance of ServletConfig

  • Sé el primero en comentar

  • Sé el primero en recomendar esto

Reading init param

  1. 1. Reading init param By Sana mateen
  2. 2. ServletConfig interface • What is the need? • Sometimes we may have a requirement that a value keeps changing time to time and so we do not want to hard code it into a servlet. If it is done, we will have to change the value and again recompile the servlet. • How can it be achieved? • Servlet specification provides a way to provide init parameters to the servlet when it is initialized. i.e. its init() method completes. These init parameters are available in the servlet. Parameters can be accessed using public String getInitParameter(String name) method. • Advantage of ServletConfig • The core advantage of ServletConfig is that you don't need to edit the servlet file if information is modified from the web.xml file.
  3. 3. HTTP STATUS CODES • The Status-Code element in a server response, is a 3-digit integer where the first digit of the Status-Code defines the class of response and the last two digits do not have any categorization role. There are 5 values for the first digit:
  4. 4. Methods to set HTTP status code • public void setStatus ( int statusCode ) • public void sendRedirect(String url) • public void sendError(int code, String message)

×