<c:url> tag and contextPath doesn't display properly path
<p>I want to redirect a client to following paths when a particural text is clicked, but only <code>&lt;a href="${userUrl}"&gt; Query &lt;/a&gt;</code>and <code>&lt;a href="${removeUserUrl}"&gt; Remove &lt;/a&gt;</code> works properly. My contextPath is "basics" and the jsp is displayed with path "<a href="http://localhost:8080/basics/" rel="nofollow">http://localhost:8080/basics/</a>". When i click on Update or Add user, then it redirects me to "<a href="http://localhost:8080/basics/basics/users" rel="nofollow">http://localhost:8080/basics/basics/users</a>" (the jsp file is users.jsp) but it should redirects respectively to "<a href="http://localhost:8080/basics/user/update/" rel="nofollow">http://localhost:8080/basics/user/update/</a>${customer.id}" and "<a href="http://localhost:8080/basics/user/add" rel="nofollow">http://localhost:8080/basics/user/add</a>" What's wrong with that code?</p>

<p>users.jsp:</p>

<pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%&gt;
&lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Users&lt;/title&gt;

//...style
&lt;/head&gt;
&lt;body&gt;

    &lt;c:set value="${pageContext.request.contextPath}"
        var="contextUrl" /&gt;

    &lt;c:set value="${contextUrl}/user/add" var="addUserUrl" /&gt;

    &lt;table style="width: 100%"&gt;
        &lt;tr&gt;
            &lt;th&gt;#ID&lt;/th&gt;
            &lt;th&gt;Name&lt;/th&gt;
            &lt;th&gt;Age&lt;/th&gt;
            &lt;th&gt;Country&lt;/th&gt;
            &lt;td colspan="3"
                style="background-color: #0CF323; text-align: center; border-top-color: #0CF323; border-right-color: #0CF323"&gt;
                &lt;a href="&lt;c:url value='/user/add' /&gt;"&gt; Add user &lt;/a&gt;
            &lt;/td&gt;
        &lt;/tr&gt;

        &lt;c:forEach var="customer" items="${customers}"&gt;

            &lt;c:set value="${contextUrl}/user/update/${customer.id}"
                var="updateUserUrl" /&gt;
            &lt;c:set value="${contextUrl}/user/remove/${customer.id}"
                var="removeUserUrl" /&gt;
            &lt;c:set value="${contextUrl}/user/${customer.id}" var="userUrl" /&gt;

            &lt;tr&gt;
                &lt;td&gt;&lt;c:out value="${customer.id }" /&gt;&lt;/td&gt;
                &lt;td&gt;&lt;c:out value="${customer.name }" /&gt;&lt;/td&gt;
                &lt;td&gt;&lt;c:out value="${customer.age }" /&gt;&lt;/td&gt;
                &lt;td&gt;&lt;c:out value="${customer.country.country }" /&gt;&lt;/td&gt;
                &lt;td style="background-color: #17D0F5"&gt;&lt;a href="${userUrl}"&gt; Query &lt;/a&gt;&lt;/td&gt;
                &lt;td style="background-color: #FF8000"&gt;&lt;a
                    href="${updateUserUrl}"&gt; Update &lt;/a&gt;&lt;/td&gt;
                &lt;td style="background-color: #EC2727"&gt;&lt;a
                    href="${removeUserUrl}"&gt; Remove &lt;/a&gt;&lt;/td&gt;
            &lt;/tr&gt;
        &lt;/c:forEach&gt;
    &lt;/table&gt;


&lt;/body&gt;
&lt;/html&gt;
</code></pre>