java.lang.ClassNotFoundException:org.unbescape.uri.UriEscape

时间:2018-03-05 16:37:57

标签: spring thymeleaf

我尝试加载此网页时收到此错误:



<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>

    <link rel="stylesheet" type="text/css" th:href="@{/webjars/bootstrap/3.3.7/css/bootstrap.min.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/css/main.css}"/>
    <title>Competition</title>
</head>
<body>
    <div>
    
      <p th:text="'Name: ' + ${competition.name}" />
      <p th:text="'Date: ' + ${competition.date}" />
      <p th:text="'Venue: ' + ${competition.Venue}" />
      <div th:if="${competition.competitors != null}">
   		 <h3>Competitors</h3>
   		 <ul>
      	 <li th:each="item : ${competition.competitors}" th:text="${item}"></li>
 		   </ul>
	 </div>
      	<h4>Add Competitor.</h4>
    <form action="#" th:action="@{/competitions/{id}(id=${competition.id})}" th:object="${email}" method="post">
    	
        <p>User email: <input type="text" th:field="*{text}" /></p>
        <p><input type="submit" value="Submit" /> <input type="reset" value="Reset" /></p>
    </form>
      
    </div>
     <p th:text="${competition.id}"></p>
</body>
</html>
&#13;
&#13;
&#13;

我将org.unbescape依赖项添加到我的pom.xml中。

当我将URL添加到表单时,我开始收到此错误 (这一行:)

  

个:行动=&#34; @ {/比赛/ {ID}(ID = $ {competition.id})}&#34;

1 个答案:

答案 0 :(得分:0)

看起来您使用的是旧版org.unbescape。班级UriEscape在1.1.0节中介绍。参考JMeter WebDriver Sampler

您可以尝试将org.unbescape版本升级到1.1.1,如下所示吗?

<dependency>
    <groupId>org.unbescape</groupId>
    <artifactId>unbescape</artifactId>
    <version>1.1.1.RELEASE</version>
</dependency>