Абсолютное значение uri: http://www.springframework.org/tags/form не может быть разрешено ни в файле web.xml, ни в файлах jar, развернутых с помощью этого приложения. - PullRequest
0 голосов
/ 26 сентября 2018

Я работаю над проектом Spring с Maven, я поместил все свои зависимости в файл 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>LoginModule</groupId>
  <artifactId>LoginModule</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.3</source>
          <target>1.1</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <!-- https://mvnrepository.com/artifact/junit/junit -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>4.0.1</version>
        <scope>provided</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>5.1.0.RELEASE</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.12</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/taglibs/standard -->
    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>standard</artifactId>
        <version>1.1.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/javax.servlet.jsp.jstl/javax.servlet.jsp.jstl-api -->
    <dependency>
        <groupId>javax.servlet.jsp.jstl</groupId>
        <artifactId>javax.servlet.jsp.jstl-api</artifactId>
        <version>1.2.2</version>
    </dependency>
  </dependencies>
</project>

И я использую тег формы на своей странице JSP, My Jspстраница выглядит следующим образом:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>LogIn Page</title>
</head>
<body>
    <h2>LogIn Page</h2>
     <form:form id="loginForm" modelAttribute="login" action="loginProcess" method="post">
     <table align="center">
         <tr>
             <td>
                 <form:label path="username">Username: </form:label>
             </td>
             <td>
                 <form:input path="username" name="username" id="username" />
             </td>
         </tr>
         <tr>
             <td>
                 <form:label path="password">Password:</form:label>
             </td>
             <td>
                 <form:password path="password" name="password" id="password" />
             </td>
         </tr>
         <tr>
             <td></td>
             <td align="left">
                 <form:button id="login" name="login">Login</form:button>
             </td>
         </tr>
         <tr></tr>
         <tr>
             <td></td>
             <td><a href="home.jsp">Home</a>
             </td>
         </tr>
     </table>
 </form:form>
 <table align="center">
     <tr>
         <td style="font-style: italic; color: red;">${message}</td>
     </tr>
 </table>
</body>
</html>

Но, когда я пытаюсь запустить свой файл JSP, я получаю следующую ошибку:

HTTP Status 500 - The absolute uri: http://www.springframework.org/tags/form cannot be resolved in either web.xml or the jar files deployed with this application

Я полагаю, я добавил все зависимостичто требуется, но я не смог найти проблему.

Пожалуйста, поделитесь своей идеей для решения.

Заранее спасибо.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...