public class XsdSchemaHandlerAdapter extends LocationTransformerObjectSupport implements org.springframework.web.servlet.HandlerAdapter, org.springframework.beans.factory.InitializingBean
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.
XsdSchema
,
getSchemaSource(XsdSchema)
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_SCHEMA_LOCATION_EXPRESSION
Default XPath expression used for extracting all
schemaLocation attributes from the WSDL definition. |
Constructor and Description |
---|
XsdSchemaHandlerAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
long |
getLastModified(HttpServletRequest request,
Object handler) |
protected Source |
getSchemaSource(XsdSchema schema)
Returns the
Source of the given schema. |
org.springframework.web.servlet.ModelAndView |
handle(HttpServletRequest request,
HttpServletResponse response,
Object handler) |
void |
setSchemaLocationExpression(String schemaLocationExpression)
Sets the XPath expression used for extracting the
schemaLocation attributes from the WSDL 1.1 definition. |
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 . |
boolean |
supports(Object handler) |
protected void |
transformSchemaLocations(Document definitionDocument,
HttpServletRequest request)
Transforms all
schemaLocation attributes to reflect the server name given HttpServletRequest . |
transformLocation, transformLocations
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
public static final String DEFAULT_SCHEMA_LOCATION_EXPRESSION
schemaLocation
attributes from the WSDL definition.public void setSchemaLocationExpression(String schemaLocationExpression)
schemaLocation
attributes from the WSDL 1.1 definition.
Defaults to DEFAULT_SCHEMA_LOCATION_EXPRESSION
.
public void setTransformSchemaLocations(boolean transformSchemaLocations)
HttpServletRequest
. Defaults to false
.public long getLastModified(HttpServletRequest request, Object handler)
getLastModified
in interface org.springframework.web.servlet.HandlerAdapter
public org.springframework.web.servlet.ModelAndView handle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception
handle
in interface org.springframework.web.servlet.HandlerAdapter
Exception
public boolean supports(Object handler)
supports
in interface org.springframework.web.servlet.HandlerAdapter
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
protected Source getSchemaSource(XsdSchema schema) throws Exception
Source
of the given schema. Allows for post-processing and transformation of the schema in
sub-classes.
Default implementation simply returns XsdSchema.getSource()
.
schema
- the schemaException
- in case of errorsprotected void transformSchemaLocations(Document definitionDocument, HttpServletRequest request) throws Exception
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.