Read and respond to this message at: 
https://sourceforge.net/forum/message.php?msg_id=3008291
By: jconner2525

As far as I can tell there is no clean way to do this (ie. no implicit 
variable).
Here is a code snippet I wrote to achieve a good enough solution for me, maybe
it will help someone else out there.

  public void addPageAndSortParam(HttpServletRequest request, String formId) {

    //ex. d-16344-p=2 page
    //ex. d-16344-s=0 sort
    //ex. d-16344-o=1 ascending or descending

    ParamEncoder paramEncoder = new ParamEncoder(formId);
    String pageParamName = paramEncoder.encodeParameterName("p");
    String sortParamName = paramEncoder.encodeParameterName("s");
    String orderParamName = paramEncoder.encodeParameterName("o");

    String pageValue = request.getParameter(pageParamName);
    String sortValue = request.getParameter(sortParamName);
    String orderValue = request.getParameter(orderParamName);

    StringBuffer result = new StringBuffer();
    
    if (pageValue != null) {
      addNameAndValue(result, pageParamName, pageValue);
    }

    if (sortValue != null) {
      addNameAndValue(result, sortParamName, sortValue);
    }

    if (orderValue != null) {
      addNameAndValue(result, orderParamName, orderValue);
    }
    
    request.setAttribute("pageAndSort", result.toString());
  }


  public void addNameAndValue(StringBuffer result, String name, String value) {
    
    result.append("&");
    result.append(name);
    result.append("=");
    result.append(value);
  }


I then just added the following to my url:
<a href="<c:out value='${deleteUrl}' escapeXml='false'/><c:out
value='${pageAndSort}'/>">delete</a>

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit: 
https://sourceforge.net/forum/unmonitor.php?forum_id=249318


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to