相关疑难解决方法(0)

等价于Spring Boot MVC的web.xml <jsp-config>?

JSP规范允许我.html使用中的<jsp-config>部分将文件作为JSP 提供服务(即,让容器将它们作为JSP文件处理)web.xml

<web-app …>
  <jsp-config>
    <jsp-property-group>
      <url-pattern>*.html</url-pattern>
    </jsp-property-group>
  </jsp-config>
</web-app>
Run Code Online (Sandbox Code Playgroud)

但是,当我切换到@SpringBootApplication使用嵌入式Tomcat 运行时,它将完全绕过该web.xml文件。Spring Boot MVC中是否有等效的设置来按照标准设置JSP属性组的JSP配置web.xml,该配置将配置现有的嵌入式Tomcat JSP servlet?

(我可能要配置的JSP设置的另一个示例是<trim-directive-whitespaces>。)

在将其标记为重复项之前,请仔细阅读。我知道沃克罗斯广泛回答但是该答案仅考虑添加新的 JSP servlet。它没有解决向现有的 JSP servlet 添加新的JSP属性组的问题,并且实际上根本没有提及该<jsp-config>部分web.xml

java spring jsp spring-mvc spring-boot

8
推荐指数
1
解决办法
477
查看次数

弹簧启动与s​​pring-ws -SOAP端点无法访问

我正在玩spring-boot,我遇到了一个问题.创建RESTful Web服务非常简单.但我无法使用spring-boot运行soap服务.

实际上我的项目有spring-boot-starter-web依赖.

是否需要额外的sprint-boot-starter尚不存在?

有什么办法吗?如果我有一个SOAP服务的web.xml,我可以在初始化过程中以某种方式包含它吗?我知道类似的问题已经存在,但它并没有解决我的问题,因为那里的问题是基于spring-web.所以我认为我的问题在其他地方.

我的soap-webservice的端点看起来像这样:

@Endpoint
public class MyEndpoint {


    @PayloadRoot(localPart = "myRequest", namespace = "my.ns")
    @ResponsePayload
    public TResponse logRequest(@RequestPayload final TRequest request) {
        //some code
    }
//more methods
}
Run Code Online (Sandbox Code Playgroud)

端点在xml中是奇怪的,xml由spring-boot通过ImportResource注释加载.

所以我的入门级看起来像这样:

@Configuration
@EnableAutoConfiguration
@ImportResource({ "classpath:/my/pack/app.xml" }) //soap-endpoint is configured here. 
public class Example {

    public static void main(final String[] args) {
        SpringApplication.run(Example.class, args);
    }
}
Run Code Online (Sandbox Code Playgroud)

端点的配置

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:web-services="http://www.springframework.org/schema/web-services"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/web-services http://www.springframework.org/schema/web-services/web-services.xsd …
Run Code Online (Sandbox Code Playgroud)

java spring soap web-services spring-boot

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

java ×2

spring ×2

spring-boot ×2

jsp ×1

soap ×1

spring-mvc ×1

web-services ×1