jetbrains.buildServer.controllers
Class BaseController

java.lang.Object
  extended by org.springframework.context.support.ApplicationObjectSupport
      extended by org.springframework.web.context.support.WebApplicationObjectSupport
          extended by org.springframework.web.servlet.support.WebContentGenerator
              extended by org.springframework.web.servlet.mvc.AbstractController
                  extended by jetbrains.buildServer.controllers.BaseController
All Implemented Interfaces:
org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller
Direct Known Subclasses:
BaseFormXmlController, BasePopupController

public abstract class BaseController
extends org.springframework.web.servlet.mvc.AbstractController

Base class for all of the TeamCity web controllers


Field Summary
protected  SBuildServer myServer
          Initialized if controller is created with constructor: BaseController(jetbrains.buildServer.serverSide.SBuildServer)
 
Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator
METHOD_GET, METHOD_HEAD, METHOD_POST
 
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport
logger
 
Constructor Summary
protected BaseController()
          Constructor
protected BaseController(SBuildServer server)
          Constructor.
 
Method Summary
protected abstract  org.springframework.web.servlet.ModelAndView doHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Performs actual request processing
protected  ActionMessages getOrCreateMessages(javax.servlet.http.HttpServletRequest request)
          Returns messages storage associated with specified HTTP request
 org.springframework.web.servlet.ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Calls doHandle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) method and performs processing of some common exceptions.
static boolean isGet(javax.servlet.http.HttpServletRequest request)
           
protected  boolean isPost(javax.servlet.http.HttpServletRequest request)
           
protected  org.springframework.web.servlet.ModelAndView simpleView(java.lang.String message)
          Creates simple view which will display the specified message.
 
Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession
 
Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseCacheControlNoStore, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseCacheControlNoStore, setUseExpiresHeader
 
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext
 
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myServer

protected SBuildServer myServer
Initialized if controller is created with constructor: BaseController(jetbrains.buildServer.serverSide.SBuildServer)

Constructor Detail

BaseController

protected BaseController(@NotNull
                         SBuildServer server)
Constructor.

Parameters:
server - SBuildServer instance

BaseController

protected BaseController()
Constructor

Method Detail

handleRequestInternal

public final org.springframework.web.servlet.ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request,
                                                                                javax.servlet.http.HttpServletResponse response)
                                                                         throws java.lang.Exception
Calls doHandle(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) method and performs processing of some common exceptions. Every page will also be provided with the following set of additional properties:

Specified by:
handleRequestInternal in class org.springframework.web.servlet.mvc.AbstractController
Parameters:
request - HTTP request
response - HTTP response
Returns:
model and view components
Throws:
java.lang.Exception - exception

doHandle

@Nullable
protected abstract org.springframework.web.servlet.ModelAndView doHandle(@NotNull
                                                                                  javax.servlet.http.HttpServletRequest request,
                                                                                  @NotNull
                                                                                  javax.servlet.http.HttpServletResponse response)
                                                                  throws java.lang.Exception
Performs actual request processing

Parameters:
request - HTTP request
response - HTTP response
Returns:
model and view components
Throws:
java.lang.Exception - exception

getOrCreateMessages

@NotNull
protected ActionMessages getOrCreateMessages(@NotNull
                                                     javax.servlet.http.HttpServletRequest request)
Returns messages storage associated with specified HTTP request

Parameters:
request - HTTP request
Returns:
messages storage

simpleView

protected org.springframework.web.servlet.ModelAndView simpleView(@NotNull
                                                                  java.lang.String message)
Creates simple view which will display the specified message.

Parameters:
message - message to display
Returns:
simple view which will display the specified message

isPost

protected boolean isPost(@NotNull
                         javax.servlet.http.HttpServletRequest request)

isGet

public static boolean isGet(@NotNull
                            javax.servlet.http.HttpServletRequest request)