Question

The problem is that with some tomcat server the link tags who are & in the href value is translated to & when the page is shown but with other tomcat 7.0.47 is not and It looks very strange because it should work.

I use this:

<jsp:directive.page contentType="text/html;charset=UTF-8"/>
<jsp:directive.page pageEncoding="UTF-8"/>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=8"/>
</head>

But it continues without work fot his tomcat version.

I am using spring-mvc and the project was configured using spring-roo.

The problem happen in this custom tag.

 <menu:item id="fi_user_username" messageCode="global_menu_find"
                       url="/movies?find=ByMoviename&amp;form"
                       z="Pt1/VjKgu7t6Aha3OJt4uC0yZR4="/>

Inside the custom tag url is the ${url}.

            <spring:url value="${url}" var="menu_item_url"/>
            <a href="${menu_item_url}" title="${fn:escapeXml(label)}" id="${fn:escapeXml(id)}_a">
            <c:out value="${label}"/>

The web that is given to the browser appears the element like this:

<a id="fi_movie_moviename_a" title="Find by Moviename" href="/movie-server/movies?find=ByMoviename&amp;form" class="selected_movie_submenu">Find by Movie name</a>

Tomcat has the configuration for default.

Thanks for helping.

Was it helpful?

Solution

I had the same problem after upgrading from 7.0.42 to 7.0.47. It looks like both "Tomcat" and the Spring tag are escaping &.

To prevent Spring from escaping the URL, you can add htmlEscape="false" to the url tag.

OTHER TIPS

Also had this problem and was using the htmlEscape="false" work around mentioned above. It appears to be fixed in Tomcat 7.0.50, although I don't see it mentioned in the change log:

http://tomcat.apache.org/tomcat-7.0-doc/changelog.html

However it's possible that I missed it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top