24 changed files with 593 additions and 289 deletions
@ -0,0 +1,46 @@
@@ -0,0 +1,46 @@
|
||||
/* |
||||
* Copyright 2002-present the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.docs.web.webmvcview.mvcviewfreemarkercontextconfig; |
||||
|
||||
import java.nio.charset.StandardCharsets; |
||||
|
||||
import org.springframework.context.annotation.Bean; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry; |
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
||||
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer; |
||||
|
||||
// tag::snippet[]
|
||||
@Configuration |
||||
public class WebConfiguration implements WebMvcConfigurer { |
||||
|
||||
@Override |
||||
public void configureViewResolvers(ViewResolverRegistry registry) { |
||||
registry.freeMarker(); |
||||
} |
||||
|
||||
// Configure FreeMarker...
|
||||
|
||||
@Bean |
||||
public FreeMarkerConfigurer freeMarkerConfigurer() { |
||||
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer(); |
||||
configurer.setTemplateLoaderPath("/WEB-INF/freemarker"); |
||||
configurer.setDefaultCharset(StandardCharsets.UTF_8); |
||||
return configurer; |
||||
} |
||||
} |
||||
// end::snippet[]
|
||||
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
/* |
||||
* Copyright 2002-present the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.docs.web.webmvcview.mvcviewgroovymarkupconfiguration; |
||||
|
||||
import org.springframework.context.annotation.Bean; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry; |
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
||||
import org.springframework.web.servlet.view.groovy.GroovyMarkupConfigurer; |
||||
|
||||
// tag::snippet[]
|
||||
@Configuration |
||||
public class WebConfiguration implements WebMvcConfigurer { |
||||
|
||||
@Override |
||||
public void configureViewResolvers(ViewResolverRegistry registry) { |
||||
registry.groovy(); |
||||
} |
||||
|
||||
// Configure the Groovy Markup Template Engine...
|
||||
|
||||
@Bean |
||||
public GroovyMarkupConfigurer groovyMarkupConfigurer() { |
||||
GroovyMarkupConfigurer configurer = new GroovyMarkupConfigurer(); |
||||
configurer.setResourceLoaderPath("/WEB-INF/"); |
||||
return configurer; |
||||
} |
||||
} |
||||
// end::snippet[]
|
||||
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
/* |
||||
* Copyright 2002-present the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.docs.web.webmvcview.mvcviewjspresolver; |
||||
|
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry; |
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
||||
|
||||
// tag::snippet[]
|
||||
@Configuration |
||||
public class WebConfiguration implements WebMvcConfigurer { |
||||
|
||||
@Override |
||||
public void configureViewResolvers(ViewResolverRegistry registry) { |
||||
registry.jsp(); |
||||
} |
||||
} |
||||
// end::snippet[]
|
||||
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
/* |
||||
* Copyright 2002-present the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.docs.web.webmvcview.mvcviewscriptintegrate; |
||||
|
||||
import org.springframework.context.annotation.Bean; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry; |
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
||||
import org.springframework.web.servlet.view.script.ScriptTemplateConfigurer; |
||||
|
||||
// tag::snippet[]
|
||||
@Configuration |
||||
public class WebConfiguration implements WebMvcConfigurer { |
||||
|
||||
@Override |
||||
public void configureViewResolvers(ViewResolverRegistry registry) { |
||||
registry.scriptTemplate(); |
||||
} |
||||
|
||||
@Bean |
||||
public ScriptTemplateConfigurer configurer() { |
||||
ScriptTemplateConfigurer configurer = new ScriptTemplateConfigurer(); |
||||
configurer.setEngineName("jython"); |
||||
configurer.setScripts("render.py"); |
||||
configurer.setRenderFunction("render"); |
||||
return configurer; |
||||
} |
||||
} |
||||
// end::snippet[]
|
||||
@ -0,0 +1,39 @@
@@ -0,0 +1,39 @@
|
||||
/* |
||||
* Copyright 2002-present the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.docs.web.webmvcview.mvcviewsfreemarker; |
||||
|
||||
import java.util.Map; |
||||
|
||||
import freemarker.template.utility.XmlEscape; |
||||
|
||||
import org.springframework.context.annotation.Bean; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer; |
||||
|
||||
@Configuration |
||||
public class WebConfiguration { |
||||
|
||||
// tag::snippet[]
|
||||
@Bean |
||||
public FreeMarkerConfigurer freeMarkerConfigurer() { |
||||
FreeMarkerConfigurer configurer = new FreeMarkerConfigurer(); |
||||
configurer.setTemplateLoaderPath("/WEB-INF/freemarker"); |
||||
configurer.setFreemarkerVariables(Map.of("xml_escape", new XmlEscape())); |
||||
return configurer; |
||||
} |
||||
// end::snippet[]
|
||||
} |
||||
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
/* |
||||
* Copyright 2002-present the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.docs.web.webmvcview.mvcviewxsltbeandefs; |
||||
|
||||
import org.springframework.context.annotation.Bean; |
||||
import org.springframework.context.annotation.Configuration; |
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
||||
import org.springframework.web.servlet.view.xslt.XsltViewResolver; |
||||
|
||||
// tag::snippet[]
|
||||
@Configuration |
||||
public class WebConfiguration implements WebMvcConfigurer { |
||||
|
||||
@Bean |
||||
public XsltViewResolver xsltViewResolver() { |
||||
XsltViewResolver viewResolver = new XsltViewResolver(); |
||||
viewResolver.setPrefix("/WEB-INF/xsl/"); |
||||
viewResolver.setSuffix(".xslt"); |
||||
return viewResolver; |
||||
} |
||||
} |
||||
// end::snippet[]
|
||||
@ -0,0 +1,42 @@
@@ -0,0 +1,42 @@
|
||||
/* |
||||
* Copyright 2002-present the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0 |
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.docs.web.webmvcview.mvcviewfreemarkercontextconfig |
||||
|
||||
import org.springframework.context.annotation.Bean |
||||
import org.springframework.context.annotation.Configuration |
||||
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry |
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer |
||||
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer |
||||
import java.nio.charset.StandardCharsets |
||||
|
||||
// tag::snippet[] |
||||
@Configuration |
||||
class WebConfiguration : WebMvcConfigurer { |
||||
|
||||
override fun configureViewResolvers(registry: ViewResolverRegistry) { |
||||
registry.freeMarker() |
||||
} |
||||
|
||||
// Configure FreeMarker... |
||||
|
||||
@Bean |
||||
fun freeMarkerConfigurer() = FreeMarkerConfigurer().apply { |
||||
setTemplateLoaderPath("/WEB-INF/freemarker") |
||||
setDefaultCharset(StandardCharsets.UTF_8) |
||||
} |
||||
} |
||||
// end::snippet[] |
||||
@ -0,0 +1,40 @@
@@ -0,0 +1,40 @@
|
||||
/* |
||||
* Copyright 2002-present the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0 |
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.docs.web.webmvcview.mvcviewgroovymarkupconfiguration |
||||
|
||||
import org.springframework.context.annotation.Bean |
||||
import org.springframework.context.annotation.Configuration |
||||
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry |
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer |
||||
import org.springframework.web.servlet.view.groovy.GroovyMarkupConfigurer |
||||
|
||||
// tag::snippet[] |
||||
@Configuration |
||||
class WebConfiguration : WebMvcConfigurer { |
||||
|
||||
override fun configureViewResolvers(registry: ViewResolverRegistry) { |
||||
registry.groovy() |
||||
} |
||||
|
||||
// Configure the Groovy Markup Template Engine... |
||||
|
||||
@Bean |
||||
fun groovyMarkupConfigurer() = GroovyMarkupConfigurer().apply { |
||||
resourceLoaderPath = "/WEB-INF/" |
||||
} |
||||
} |
||||
// end::snippet[] |
||||
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
/* |
||||
* Copyright 2002-present the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0 |
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.docs.web.webmvcview.mvcviewjspresolver |
||||
|
||||
import org.springframework.context.annotation.Configuration |
||||
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry |
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer |
||||
|
||||
// tag::snippet[] |
||||
@Configuration |
||||
class WebConfiguration : WebMvcConfigurer { |
||||
|
||||
override fun configureViewResolvers(registry: ViewResolverRegistry) { |
||||
registry.jsp() |
||||
} |
||||
} |
||||
// end::snippet[] |
||||
@ -0,0 +1,40 @@
@@ -0,0 +1,40 @@
|
||||
/* |
||||
* Copyright 2002-present the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0 |
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.docs.web.webmvcview.mvcviewscriptintegrate |
||||
|
||||
import org.springframework.context.annotation.Bean |
||||
import org.springframework.context.annotation.Configuration |
||||
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry |
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer |
||||
import org.springframework.web.servlet.view.script.ScriptTemplateConfigurer |
||||
|
||||
// tag::snippet[] |
||||
@Configuration |
||||
class WebConfiguration : WebMvcConfigurer { |
||||
|
||||
override fun configureViewResolvers(registry: ViewResolverRegistry) { |
||||
registry.scriptTemplate() |
||||
} |
||||
|
||||
@Bean |
||||
fun configurer() = ScriptTemplateConfigurer().apply { |
||||
engineName = "jython" |
||||
setScripts("render.py") |
||||
renderFunction = "render" |
||||
} |
||||
} |
||||
// end::snippet[] |
||||
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
/* |
||||
* Copyright 2002-present the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0 |
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.docs.web.webmvcview.mvcviewsfreemarker |
||||
|
||||
import freemarker.template.utility.XmlEscape |
||||
import org.springframework.context.annotation.Bean |
||||
import org.springframework.context.annotation.Configuration |
||||
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer |
||||
|
||||
@Configuration |
||||
class WebConfiguration { |
||||
|
||||
// tag::snippet[] |
||||
@Bean |
||||
fun freeMarkerConfigurer() = FreeMarkerConfigurer().apply { |
||||
setTemplateLoaderPath("/WEB-INF/freemarker") |
||||
setFreemarkerVariables(mapOf("xml_escape" to XmlEscape())) |
||||
} |
||||
// end::snippet[] |
||||
} |
||||
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
/* |
||||
* Copyright 2002-present the original author or authors. |
||||
* |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* |
||||
* https://www.apache.org/licenses/LICENSE-2.0 |
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
package org.springframework.docs.web.webmvcview.mvcviewxsltbeandefs |
||||
|
||||
import org.springframework.context.annotation.Bean |
||||
import org.springframework.context.annotation.Configuration |
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer |
||||
import org.springframework.web.servlet.view.xslt.XsltViewResolver |
||||
|
||||
// tag::snippet[] |
||||
@Configuration |
||||
class WebConfiguration : WebMvcConfigurer { |
||||
|
||||
@Bean |
||||
fun xsltViewResolver() = XsltViewResolver().apply { |
||||
setPrefix("/WEB-INF/xsl/") |
||||
setSuffix(".xslt") |
||||
} |
||||
} |
||||
// end::snippet[] |
||||
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
<!-- tag::snippet[] --> |
||||
<beans xmlns="http://www.springframework.org/schema/beans" |
||||
xmlns:mvc="http://www.springframework.org/schema/mvc" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation=" |
||||
http://www.springframework.org/schema/beans |
||||
https://www.springframework.org/schema/beans/spring-beans.xsd |
||||
http://www.springframework.org/schema/mvc |
||||
https://www.springframework.org/schema/mvc/spring-mvc.xsd"> |
||||
|
||||
<mvc:view-resolvers> |
||||
<mvc:freemarker/> |
||||
</mvc:view-resolvers> |
||||
|
||||
<!-- Configure FreeMarker... --> |
||||
<mvc:freemarker-configurer> |
||||
<mvc:template-loader-path location="/WEB-INF/freemarker"/> |
||||
</mvc:freemarker-configurer> |
||||
|
||||
<!-- Alternatively, you can also declare the FreeMarkerConfigurer bean for full control over all properties --> |
||||
<!-- |
||||
<bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer"> |
||||
<property name="templateLoaderPath" value="/WEB-INF/freemarker/"/> |
||||
<property name="defaultEncoding" value="UTF-8"/> |
||||
</bean> |
||||
--> |
||||
|
||||
</beans> |
||||
<!-- end::snippet[] --> |
||||
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
<!-- tag::snippet[] --> |
||||
<beans xmlns="http://www.springframework.org/schema/beans" |
||||
xmlns:mvc="http://www.springframework.org/schema/mvc" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation=" |
||||
http://www.springframework.org/schema/beans |
||||
https://www.springframework.org/schema/beans/spring-beans.xsd |
||||
http://www.springframework.org/schema/mvc |
||||
https://www.springframework.org/schema/mvc/spring-mvc.xsd"> |
||||
|
||||
<mvc:view-resolvers> |
||||
<mvc:groovy/> |
||||
</mvc:view-resolvers> |
||||
|
||||
<!-- Configure the Groovy Markup Template Engine... --> |
||||
<mvc:groovy-configurer resource-loader-path="/WEB-INF/"/> |
||||
|
||||
</beans> |
||||
<!-- end::snippet[] --> |
||||
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
<!-- tag::snippet[] --> |
||||
<beans xmlns="http://www.springframework.org/schema/beans" |
||||
xmlns:mvc="http://www.springframework.org/schema/mvc" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation=" |
||||
http://www.springframework.org/schema/beans |
||||
https://www.springframework.org/schema/beans/spring-beans.xsd |
||||
http://www.springframework.org/schema/mvc |
||||
https://www.springframework.org/schema/mvc/spring-mvc.xsd"> |
||||
|
||||
<mvc:view-resolvers> |
||||
<mvc:jsp/> |
||||
</mvc:view-resolvers> |
||||
|
||||
</beans> |
||||
<!-- end::snippet[] --> |
||||
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
<!-- tag::snippet[] --> |
||||
<beans xmlns="http://www.springframework.org/schema/beans" |
||||
xmlns:mvc="http://www.springframework.org/schema/mvc" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation=" |
||||
http://www.springframework.org/schema/beans |
||||
https://www.springframework.org/schema/beans/spring-beans.xsd |
||||
http://www.springframework.org/schema/mvc |
||||
https://www.springframework.org/schema/mvc/spring-mvc.xsd"> |
||||
|
||||
<mvc:view-resolvers> |
||||
<mvc:script-template/> |
||||
</mvc:view-resolvers> |
||||
|
||||
<mvc:script-template-configurer engine-name="jython" render-function="render"> |
||||
<mvc:script location="render.py"/> |
||||
</mvc:script-template-configurer> |
||||
|
||||
</beans> |
||||
<!-- end::snippet[] --> |
||||
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
<!-- |
||||
~ Copyright 2002-present the original author or authors. |
||||
~ |
||||
~ Licensed under the Apache License, Version 2.0 (the "License"); |
||||
~ you may not use this file except in compliance with the License. |
||||
~ You may obtain a copy of the License at |
||||
~ |
||||
~ https://www.apache.org/licenses/LICENSE-2.0 |
||||
~ |
||||
~ Unless required by applicable law or agreed to in writing, software |
||||
~ distributed under the License is distributed on an "AS IS" BASIS, |
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
~ See the License for the specific language governing permissions and |
||||
~ limitations under the License. |
||||
--> |
||||
|
||||
<beans xmlns="http://www.springframework.org/schema/beans" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans |
||||
https://www.springframework.org/schema/beans/spring-beans.xsd"> |
||||
|
||||
<!-- tag::snippet[] --> |
||||
<bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer"> |
||||
<property name="templateLoaderPath" value="/WEB-INF/freemarker/"/> |
||||
<property name="freemarkerVariables"> |
||||
<map> |
||||
<entry key="xml_escape" value-ref="fmXmlEscape"/> |
||||
</map> |
||||
</property> |
||||
</bean> |
||||
|
||||
<bean id="fmXmlEscape" class="freemarker.template.utility.XmlEscape"/> |
||||
<!-- end::snippet[] --> |
||||
|
||||
</beans> |
||||
Loading…
Reference in new issue