在部署和尝试访问Wildfly上的EAR文件时禁止403
首先,我发现的一个问题都没有解决我的问题。 附近,但是评论中建议的解决方案无法解决我的问题,因为我index.html及其资产被复制到Web-Inf文件夹中。
我部署了我的应用程序,并且在浏览器中被禁止使用403,就好像index.html缺少,但事实并非如此。
我正在使用Wildfly 15,并从Eclipse 2022-06部署。
我的web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0">
<display-name>IdeaProjects</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
我的pom.xml:
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>IdeaProjectsImport</groupId>
<artifactId>IdeaProjectsImport</artifactId>
<version>0.0.1</version>
<packaging>war</packaging>
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<!-- MAVEN-ASSEMBLY -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.4.0</version>
<configuration>
<archive>
<manifest>
<mainClass>VorlagenWerkWebService.VorlagenWerkService.src.main.java.com.example.vorlagenwerk.HelloWorldServiceImpl</mainClass></manifest></archive></configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution></executions>
</plugin>
</plugins>
</build>
</project>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论