状态为404的springbootwhitelabel错误页面:无法解析jsp的路径

     2022-05-02     414

关键词:

我正在使用JSP文件并给出Whitelabel错误页面的spring-boot项目。 出现意外错误(类型=未找到,状态= 404)

我已将JSP放在/ src / main / webapp / pages /中,并且已使用应用程序属性给出了路径。

这具有几个模块,主要组件不包括spring-boot依赖性,它仅包括所需的特定模块。 spring-boot模块使用了从其他模块继承的代码,因为它无法单独构建。

并且特定的子模块不包括spring-boot父级作为父级,因为必须在此时定义父级。

pom.xml(由于隐私问题,某些继承为依赖项的子模块必须从pom中删除)

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>com.epic.cb</groupId>
        <artifactId>EPICCB</artifactId>
        <version>V1.00</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>M_EOD</artifactId>
    <packaging>jar</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <spring.boot.eod.version>1.5.4.RELEASE</spring.boot.eod.version>
        <spring.eod.version>4.3.4.RELEASE</spring.eod.version>
        <apache.tomcat.version>7.0.55</apache.tomcat.version>
        <com.epic.cb.version>V1.00</com.epic.cb.version>
        <sql.version>6.2.1.jre8</sql.version>
        <jquery.version>3.1.1</jquery.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>${spring.boot.eod.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <version>${spring.boot.eod.version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-batch</artifactId>
            <version>${spring.boot.eod.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <version>${spring.boot.eod.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
            <version>${apache.tomcat.version}</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery</artifactId>
            <version>${jquery.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${spring.eod.version}</version>
        </dependency>

        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>mssql-jdbc</artifactId>
            <version>${sql.version}</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>${hibernate.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-dbcp</artifactId>
            <version>${apache.tomcat.version}</version>
        </dependency>
    <dependencies>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.0.0</version>
            </plugin>
        </plugins>
    </build>
</project>

application.properties

server.port=8589

spring.mvc.view.prefix=/WEB-INF/pages/
spring.mvc.view.suffix=.jsp

EodController.java

@Controller
public class EodController {

    @Autowired
    EodSchedulerService eodSchedulerService;

    @ResponseBody
    @RequestMapping(value = "/", method = {RequestMethod.GET})
    public String viewMain() {
        return "Hello World !!!";
    }

    @RequestMapping(value = "/viewEODDashboard", method = {RequestMethod.GET})
    public String viewEODDashboard() {
        return "eodTaskDashboard";
    }

    @RequestMapping(value = "/executeEodTasks", method = {RequestMethod.GET})
    @ResponseStatus(code = HttpStatus.OK)
    public void approveEODDashboard() {
        eodSchedulerService.executeScheduledTasks();
    }
}

EodStartup.java

@SpringBootApplication
@ComponentScan("com.epic.cb.*")
public class EodStartup {

    public EodStartup() {
        //default constructor
    }

    public static void main(String[] args) throws Exception {
        SpringApplication.run(EodStartup.class, args);
    }
}

文件结构

├── src
     ├── main
     ├── java
     │    │   └── com
     │    │        └── epic
     │    │             └── cb
     │    │                  └── eod
     │    │                       ├── EodStartup.java
     │    │                       └── controller
     │    │                              └── EodController.java 
     |    |
     │    ├── resources
     │    |     └── application.properties
     │    └── webapp
     │          └── WEB-INF
     │                 └── pages
     │                       └── eodTaskDashboard.jsp

以下是我所提及的一些链接:

  1. Why do I always get Whitelabel Error Page with status "404" while running a simple Spring Boot Application
  2. Spring Boot JSP 404.Whitelabel Error Page
  3. Tomcat-embed-jasper added but jsp pages Whitelabel 404 Error
  4. Getting whitelabel error page when running springboot application等。

我想用JSP解决这个问题。 (因为它还有其他几种选择,例如:Thymeleaf)

谢谢你!

为啥我在运行简单的 Spring Boot 应用程序时总是得到状态为“404”的 Whitelabel 错误页面

】为啥我在运行简单的SpringBoot应用程序时总是得到状态为“404”的Whitelabel错误页面【英文标题】:WhydoIalwaysgetWhitelabelErrorPagewithstatus"404"whilerunningasimpleSpringBootApplication为什么我在运行简单的SpringBoot应用程序时总是得到状... 查看详情

Angular 5 - 加载资源失败:服务器响应状态为 404(未找到)

】Angular5-加载资源失败:服务器响应状态为404(未找到)【英文标题】:Angular5-Failedtoloadresource:theserverrespondedwithastatusof404(NotFound)【发布时间】:2018-09-0703:44:17【问题描述】:我正在尝试从node_modules中的包中获取svg图像,我从我... 查看详情

状态为404的springbootwhitelabel错误页面:无法解析jsp的路径

...错误页面的spring-boot项目。出现意外错误(类型=未找到,状态=404)。我已将JSP放在/src/main/webapp/pages/中,并且已使用应用程序属性给出了路径。这具有几个模块,主要组件不包括spring-boot依赖性,它仅包括所需的特定模块。spring-... 查看详情

webService 请求失败,HTTP 状态为 404

】webService请求失败,HTTP状态为404【英文标题】:webServicerequestfailedwithHTTPstatus404【发布时间】:2013-04-1003:38:54【问题描述】:我在通过webService(System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse)发送大文件时遇到问题。当文件小... 查看详情

网站地址/404.html的返回状态值是200,其他错误页面是404?

网站地址/404.html的返回状态值是200,其他错误页面是404?网站地址/404.html的返回状态值是200,不是404?这样是不是没设置好(一)Apache下设置404错误页面为ApacheServer设置404错误页面的方法很简单,只需在.htaccess文件中加入如下内容... 查看详情

“加载资源失败:服务器响应状态为 404”express docker

】“加载资源失败:服务器响应状态为404”expressdocker【英文标题】:"Failedtoloadresource:theserverrespondedwithastatusof404"expressdocker【发布时间】:2019-01-2720:38:51【问题描述】:我在浏览器中收到错误消息“加载资源失败:服务器... 查看详情

错误:加载资源失败:服务器响应状态为 404(未找到)

】错误:加载资源失败:服务器响应状态为404(未找到)【英文标题】:Error:Failedtoloadresource:theserverrespondedwithastatusof404(NotFound)【发布时间】:2017-07-0304:36:14【问题描述】:这是我第一次在线上传网站。Here是链接。我正在使用轮... 查看详情

加载资源失败:服务器响应状态为 404(未找到)

】加载资源失败:服务器响应状态为404(未找到)【英文标题】:Failedtoloadresource:theserverrespondedwithastatusof404(NOTFOUND)【发布时间】:2013-03-3003:23:16【问题描述】:我是uisngpython,要将数据从json文件显示到页面,我收到以下错误Fail... 查看详情

加载资源失败:服务器响应状态为 404(未找到)显示在控制台上

】加载资源失败:服务器响应状态为404(未找到)显示在控制台上【英文标题】:Failedtoloadresource:theserverrespondedwithastatusof404(NotFound)displayedonconsole【发布时间】:2021-10-2319:00:43【问题描述】:Image我的文件结构是index.html、script.js... 查看详情

加载资源失败:服务器响应状态为 404 (Not Found) angular js + ionic

】加载资源失败:服务器响应状态为404(NotFound)angularjs+ionic【英文标题】:Failedtoloadresource:theserverrespondedwithastatusof404(NotFound)angularjs+ionic【发布时间】:2014-09-2523:27:12【问题描述】:这是我在GoogleDevtTools中遇到的错误。有谁知道这... 查看详情

Apache Cordova:“加载资源失败:服务器响应状态为 404(未找到)”

】ApacheCordova:“加载资源失败:服务器响应状态为404(未找到)”【英文标题】:ApacheCordova:"Failedtoloadresource:theserverrespondedwithastatusof404(NotFound)"【发布时间】:2016-01-0408:48:27【问题描述】:我收到错误消息:“加载资源... 查看详情

如何将不存在的页面显示为404错误页面

...500错误页面我现在想让它显示为404错误页面查看HTTP返回状态值应该是404,不要返回302,200状态码请问这个怎么做啊?谢谢!参考技术A打开iis管理器,在站点上按右键,属性=》自定义错误这里可以配置你想显示的任意文件内容... 查看详情

PayPal IPN 交付状态设置为“重试”,HTTP 响应代码为 404

】PayPalIPN交付状态设置为“重试”,HTTP响应代码为404【英文标题】:PayPalIPNDeliverystatussetto"Retrying"withHTTPresponsecode404【发布时间】:2012-07-3108:06:48【问题描述】:我正在使用Wordpress插件DonatePlus,它已经有一段时间没有更... 查看详情

iis绑定域名访问为404

...用的是共享IP的vps域名解析没有错的1、404是W3C规定的HTTP状态码中的一种。是WWW网站访问比较经常出现的错误。最常见的出错提示:404NOTFOUND。404页面就是当用户输入了错误的链接时,返回的页面。404页面的目的是:告诉浏览者其... 查看详情

加载资源失败:服务器使用 laravel 8 / ajax 响应状态为 404(未找到)

】加载资源失败:服务器使用laravel8/ajax响应状态为404(未找到)【英文标题】:Failedtoloadresource:theserverrespondedwithastatusof404(NotFound)usinglaravel8/ajax【发布时间】:2021-09-1018:09:10【问题描述】:我正在尝试在HTMLbloc中显示图像,所以... 查看详情

为啥 Wordpress 无法加载资源?它表示服务器响应状态为 404(未找到)

】为啥Wordpress无法加载资源?它表示服务器响应状态为404(未找到)【英文标题】:whyWordpressfailedtoloadtheresource?Itsaidthattheserverrespondedwithastatusof404(notFound)为什么Wordpress无法加载资源?它表示服务器响应状态为404(未找到)【发布... 查看详情

加载资源失败:服务器响应状态为 404(未找到)

】加载资源失败:服务器响应状态为404(未找到)【英文标题】:Failedtoloadresource:theserverrespondedwithastatus404(notfound)【发布时间】:2015-12-0117:06:28【问题描述】:我在javascript和ajax上遵循lynda教程,并在主题“使用同步XHR请求”主... 查看详情

在本地解析服务器上运行的解析仪表板错误出现:加载资源失败:服务器响应状态为 404(未找到)

...运行的解析仪表板错误出现:加载资源失败:服务器响应状态为404(未找到)【英文标题】:parse-dashboardrunningonlocalparse-servererrorsoutinwith:Failedtoloadresource:theserverrespondedwithastatusof404(NotFound)【发布时间】:2021-11-0121:59:01【问题描述... 查看详情