我在jsp页面中弹出url标记时遇到问题。 这是我的index.jsp页面: spring:url显示错误的URL
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<spring:url var="registrationUrl" value="/register"/>
<!DOCTYPE html>
<html>
<body>
<h2>Index page</h2>
<a href="${registrationUrl}">Register</a>
</body>
</html>
点击 “注册” 链接我的网址格式后看起来是这样的:而不是 http://localhost:8080/$%7BregistrationUrl%7D
: http://localhost:8080/register
这样的问题:我错过了什么?
您确定该页面正在作为JSP进行处理,而不是以纯静态HTML格式发送?你可以在浏览器的“查看源代码”中查看它,并确保所有的脚本都消失了吗? – RealSkeptic
是的,我在浏览器中查看该页面看起来像纯HTML –