com.xenonsoft.bridgetown.test.servlets
Class CalcServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bycom.xenonsoft.bridgetown.test.servlets.CalcServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class CalcServlet
extends javax.servlet.http.HttpServlet

Calculation Service servlet

Version:
$Id: CalcServlet.java,v 1.1.1.1 2004/09/04 12:04:31 peter_pilgrim Exp $
Author:
Peter Pilgrim, 24-Aug-2004
See Also:
Serialized Form

Field Summary
static java.lang.String FIRST_NUMBER_ATTR
          First number JSP scope attribute name
static java.lang.String INPUT_VIEW
          The input view (hard coded for this demonstration, use a web MVC framework like Jakarta Struts)
static java.lang.String OPERATOR_ATTR
          Operator JSP scope attribute name
static java.lang.String OUTPUT_VIEW
          The output view (hard coded for this demonstration, use a web MVC framework like Jakarta Struts)
static java.lang.String RESULT_ATTR
          Result request JSP scope attribute name
static java.lang.String SECOND_NUMBER_ATTR
          Second number JSP scope attribute name
static java.math.BigDecimal ZERO
          Short cut for a global BigDecimal 0.0 object
 
Constructor Summary
CalcServlet()
          Default constructor
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Implements / overrides doGet, executes the user's calculation using the calculation service bean.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Implements / overrides doPost, simply calls the method doGet() and returns.
 void init()
          Initialises the servlets Implements / overrides init
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INPUT_VIEW

public static final java.lang.String INPUT_VIEW
The input view (hard coded for this demonstration, use a web MVC framework like Jakarta Struts)

See Also:
Constant Field Values

OUTPUT_VIEW

public static final java.lang.String OUTPUT_VIEW
The output view (hard coded for this demonstration, use a web MVC framework like Jakarta Struts)

See Also:
Constant Field Values

FIRST_NUMBER_ATTR

public static final java.lang.String FIRST_NUMBER_ATTR
First number JSP scope attribute name

See Also:
Constant Field Values

SECOND_NUMBER_ATTR

public static final java.lang.String SECOND_NUMBER_ATTR
Second number JSP scope attribute name

See Also:
Constant Field Values

OPERATOR_ATTR

public static final java.lang.String OPERATOR_ATTR
Operator JSP scope attribute name

See Also:
Constant Field Values

RESULT_ATTR

public static final java.lang.String RESULT_ATTR
Result request JSP scope attribute name

See Also:
Constant Field Values

ZERO

public static final java.math.BigDecimal ZERO
Short cut for a global BigDecimal 0.0 object

Constructor Detail

CalcServlet

public CalcServlet()
Default constructor

Method Detail

init

public void init()
Initialises the servlets Implements / overrides init

See Also:
GenericServlet.init()

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException,
                  javax.servlet.ServletException
Implements / overrides doGet, executes the user's calculation using the calculation service bean. This method retrieves the web application assembler from the servlet context. It, then, retrieves the ICalcService service bean in order to run the user's requested calculation. By the time the service bean is asked for the dependency have already been injected by the IoC framework.

Parameters:
request -
response -
Throws:
java.io.IOException
javax.servlet.ServletException
See Also:
HttpServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws java.io.IOException,
                   javax.servlet.ServletException
Implements / overrides doPost, simply calls the method doGet() and returns.

Parameters:
request -
response -
Throws:
java.io.IOException
javax.servlet.ServletException
See Also:
HttpServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse), doGet(HttpServletRequest, HttpServletResponse)


Copyright © 2005 XeNoNSoFT.com. All Rights Reserved.