ch3.sharedVariable
Class Controller

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by ch3.sharedVariable.error.Controller
              extended by ch3.sharedVariable.Controller
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class Controller
extends Controller

Extends the controller that has the shared error. The only method that is different is the incrementSharedVariable method.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ch3.sharedVariable.error.Controller
accessCount
 
Constructor Summary
Controller()
           
 
Method Summary
 void incrementSharedVariable()
          Use a synchronized block to avoid the shared error.
 
Methods inherited from class ch3.sharedVariable.error.Controller
doGet
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Controller

public Controller()
Method Detail

incrementSharedVariable

public void incrementSharedVariable()
Use a synchronized block to avoid the shared error.

This method slows down the web app. A better solution is to avoid using member varialbes in the controller.

Overrides:
incrementSharedVariable in class Controller