Continuum

Use standard jstl for links or they will break

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.1-alpha-1
  • Component/s: Web interface
  • Labels:
    None
  • Complexity:
    Intermediate
  • Number of attachments :
    1

Description

I see a lot of links constructed like this

<a href="${pageContext.request.contextPath}/deleteUser!doDelete.action?accountId=${pageScope.user.accountId}&username=${pageScope.user.username}"><ww:text name="delete"/></a>

This will break under certain circustancies, like cookies disabled or variables with some chars that need to be encoded
Also jstl automatically adds the contextPath at the beggining
See http://www-128.ibm.com/developerworks/java/library/j-jstl0318/#N105D3 for more info

The right way do do it is

<c:url var="deleteUserUrl" value="/deleteUser!doDelete.action">
<c:param name="accountId" value="${user.accountId}"/>
<c:param name="username" value="${user.username}"/>
</c:url>

<a href="<c:out value='${deleteUserUrl}'/>"><ww:text name="delete"/></a>

when no parameters need to be added it can just be

<a href="<c:url value="/deleteUser!doDelete.action">"><ww:text name="delete"/></a>

Activity

Hide
Carlos Sanchez added a comment -

Henri, please take care of this.Fix it in trunk for the pages already there. I'll merge trunk to the branch later.

Show
Carlos Sanchez added a comment - Henri, please take care of this.Fix it in trunk for the pages already there. I'll merge trunk to the branch later.
Hide
Henry S. Isidro added a comment -

attached: CONTINUUM-778-continuum-webapp.patch

Here's a patch that fixes all the jsps in the webapp module.

Show
Henry S. Isidro added a comment - attached: CONTINUUM-778-continuum-webapp.patch Here's a patch that fixes all the jsps in the webapp module.
Hide
Carlos Sanchez added a comment -

Applied, addUserRole.jsp in the branch needs also the fix

Show
Carlos Sanchez added a comment - Applied, addUserRole.jsp in the branch needs also the fix
Hide
Brett Porter added a comment -

while those no need to change the existing ones, you might like to use <ww:url/> for the other links. It is basically the same, but let's you specify it in terms of namespace, action and method.

Show
Brett Porter added a comment - while those no need to change the existing ones, you might like to use <ww:url/> for the other links. It is basically the same, but let's you specify it in terms of namespace, action and method.
Hide
Henry S. Isidro added a comment -

A patch for CONTINUUM-790 contains the fix for addUserRole.jsp.

Show
Henry S. Isidro added a comment - A patch for CONTINUUM-790 contains the fix for addUserRole.jsp.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: