### Eclipse Workspace Patch 1.0 #P stripes-svn Index: stripes/src/net/sourceforge/stripes/tag/LinkTagSupport.java =================================================================== --- stripes/src/net/sourceforge/stripes/tag/LinkTagSupport.java (revision 949) +++ stripes/src/net/sourceforge/stripes/tag/LinkTagSupport.java (working copy) @@ -37,6 +37,7 @@ private String event; private Object beanclass; private String url; + private String anchor; private boolean addSourcePage = false; private boolean prependContext = true; @@ -101,8 +102,28 @@ * @return the name of an ActionBean class, or Class object */ public Object getBeanclass() { return beanclass; } + + /** + * Gets the anchor element that is appended at the end of the URL. + * + * @return the anchor element + */ + public String getAnchor() { + return anchor; + } /** + * Sets the anchor element that is appended at the end of the URL. + * If the provided URL (set using setUrl method) already contains + * the anchor, then the anchor specified by this attribute takes precedence. + * + * @param anchor the name of the anchor to set + */ + public void setAnchor(String anchor) { + this.anchor = anchor; + } + + /** * Get the flag that indicates if the _sourcePage parameter should be * appended to the URL. * @@ -173,6 +194,9 @@ builder.addParameter(StripesConstants.URL_KEY_SOURCE_PAGE, CryptoUtil.encrypt(request.getServletPath())); } + if(this.anchor != null) { + builder.setAnchor(anchor); + } builder.addParameters(this.parameters); // Prepend the context path, but only if the user didn't already