Expert Spring MVC and Web Flow

(Dana P.) #1

The preceding diagram shows that all of the Spring Viewimplementations extend
AbstractViewand that the majority also descend from AbstractUrlBasedView. Figure 7-2
shows more detail for these classes.


Figure 7-2.Abstract superclass detail in the View hierarchy


Spring views don’t necessarily need to be HTML-based. In many cases, entirely different
content types, including binary, can be rendered to the client. All Spring views support the
ability to determine their own content type through AbstractView.setContentType().


+DEFAULT CONTENT TYPE : String


  • beanName : String

  • contentType : String

  • requestContextAttitude : String

  • staticAttributes : HashMap



  • setBeanName(beanName : String)

  • getBeanName() : String

  • setContentType(contentType : String)

  • getContentType() : String

  • setRequestContextAttribute(requestContextAttitude : String)

  • getRequestContextAttribute() : String

  • setAttributesCSV(propString : String)

  • setAttributes(props : Properties)

  • setAttributesMap(attributes : Map)

  • getAttributesMap() : Map

  • addStaticAttribute(name : String, value : Object)

  • getStaticAttributes() : Map

  • render(model : Map, request : HttpServletRequest, response : HttpServletResponse)

    createRequestContext(request : HttpServletRequest, model : Map) : support.RequestContext


    renderMergedOutputModel(model : Map, request : HttpServletRequest, response : HttpServletResponse)



  • toString() : String


AbstractView


  • url : String



  • setUrl(url : String)

  • getUrl() : String

  • afterPropertiesSet()

  • toString() : String


AbstractUrlBasedView

‹‹interface››
InitializingBean
+ afterPropertiesSet()

+ render(model : Map, request : HttpServletRequest, response : HttpServletResponse)

‹‹interface››
View ‹‹interface››
BeanNameAware
+ setBeanName(name : String)

CHAPTER 7 ■THE VIEW LAYER 205
Free download pdf