Issue
i have a problem with spring url tag in my jsp page. Here is my index.jsp page:
<%@ 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>
after clicking on "Register" link my URL format looks like this: http://localhost:8080/$%7BregistrationUrl%7D
instead of: http://localhost:8080/register
so the question: what i am missing?
Solution
I found the solution. I didn't expect but the problem was in my web.xml. It used old xml schema:
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
so i replice this to newest schema:
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
Thanks all to try help me. P.S. Sorry for my bad engilsh.
Answered By - Dmitriy Tatarenko
Answer Checked By - Cary Denson (JavaFixing Admin)