Class XsdSchemaHandlerAdapter

All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.web.servlet.HandlerAdapter

public class XsdSchemaHandlerAdapter extends LocationTransformerObjectSupport implements org.springframework.web.servlet.HandlerAdapter, org.springframework.beans.factory.InitializingBean
Adapter to use the XsdSchema interface with the generic DispatcherServlet.

Reads the source from the mapped XsdSchema implementation, and writes that as the result to the HttpServletResponse. Allows for post-processing the schema in subclasses.

Since:
1.5.3
Author:
Arjen Poutsma
See Also:
  • Field Details

    • DEFAULT_SCHEMA_LOCATION_EXPRESSION

      public static final String DEFAULT_SCHEMA_LOCATION_EXPRESSION
      Default XPath expression used for extracting all schemaLocation attributes from the WSDL definition.
      See Also:
  • Constructor Details

    • XsdSchemaHandlerAdapter

      public XsdSchemaHandlerAdapter()
  • Method Details

    • setSchemaLocationExpression

      public void setSchemaLocationExpression(String schemaLocationExpression)
      Sets the XPath expression used for extracting the schemaLocation attributes from the WSDL 1.1 definition.

      Defaults to DEFAULT_SCHEMA_LOCATION_EXPRESSION.

    • setTransformSchemaLocations

      public void setTransformSchemaLocations(boolean transformSchemaLocations)
      Sets whether relative address schema locations in the WSDL are to be transformed using the request URI of the incoming HttpServletRequest. Defaults to false.
    • getLastModified

      public long getLastModified(jakarta.servlet.http.HttpServletRequest request, Object handler)
      Specified by:
      getLastModified in interface org.springframework.web.servlet.HandlerAdapter
    • handle

      public org.springframework.web.servlet.ModelAndView handle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Object handler) throws Exception
      Specified by:
      handle in interface org.springframework.web.servlet.HandlerAdapter
      Throws:
      Exception
    • supports

      public boolean supports(Object handler)
      Specified by:
      supports in interface org.springframework.web.servlet.HandlerAdapter
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • getSchemaSource

      protected Source getSchemaSource(XsdSchema schema) throws Exception
      Returns the Source of the given schema. Allows for post-processing and transformation of the schema in sub-classes.

      Default implementation simply returns XsdSchema.getSource().

      Parameters:
      schema - the schema
      Returns:
      the source of the given schema
      Throws:
      Exception - in case of errors
    • transformSchemaLocations

      protected void transformSchemaLocations(Document definitionDocument, jakarta.servlet.http.HttpServletRequest request) throws Exception
      Transforms all schemaLocation attributes to reflect the server name given HttpServletRequest. Determines the suitable attributes by evaluating the defined XPath expression, and delegates to transformLocation to do the transformation for all attributes that match.

      This method is only called when the transformSchemaLocations property is true.

      Throws:
      Exception
      See Also: