Home > other >  How to put class attribute in <c:url>?
How to put class attribute in <c:url>?

Time:02-20

This is the link I have

        <a  href="/menu">Name</a>

I want to transform it to <c:url> to be able to use <c:param>

I've tried this, but it does not give me a way to put class attritbute so that my css works.

    <c:url value="/menu">
 <c:param name="Id" value="736"/>
 <c:param name="user" value="example"/>
</c:url>

CodePudding user response:

Here is one solution.

    <c:url value="/menu" context="${pageContext.request.contextPath}" var="menuUrl">
        <c:param name="Id" value="736"/>
        <c:param name="user" value="example"/>
    </c:url>
    <a  href="${menuUrl}">Name</a>
  • Related