下面的代码是在我的Thymeleaf模板:
<form action="#" th:object="${userDto}" method="post">
...
<img alt="" src="@{/ProfileImageServlet?imageId=*{profileImageId}}"
width="100" style="border-radius: 50%;" >
其中,ProfileImageServlet应该使用参数 *{profileImageId}(userDto中的属性)中的图像ID动态生成图像。但是,这并没有发生。应用程序失败,并显示以下错误:
java.lang.IllegalArgumentException: Invalid character found in the request target [/@%7B/ProfileImageServlet?imageId=*{profileImageId}} ]. The valid characters are defined in RFC 7230 and RFC 3986
请帮帮忙。
1条答案
按热度按时间yebdmbv41#
您需要使用
th:src
,而不是src
: