Revision: 984
http://stripes.svn.sourceforge.net/stripes/?rev=984&view=rev
Author: bengunter
Date: 2008-10-21 14:55:16 +0000 (Tue, 21 Oct 2008)
Log Message:
-----------
Applied the fix for STS-595 from the trunk.
Modified Paths:
--------------
branches/1.5.x/stripes/resources/stripes.tld
branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/LinkTagSupport.java
Modified: branches/1.5.x/stripes/resources/stripes.tld
===================================================================
--- branches/1.5.x/stripes/resources/stripes.tld 2008-10-21 14:53:30 UTC
(rev 983)
+++ branches/1.5.x/stripes/resources/stripes.tld 2008-10-21 14:55:16 UTC
(rev 984)
@@ -817,6 +817,14 @@
<type>java.lang.Object</type>
</attribute>
<attribute>
+ <description>
+ The (optional) anchor that is appended at the end of the
generated URL.
+ If the URL specified by the value attribute already contains
the anchor then
+ the anchor specified by this attribute takes precedence.
+ </description>
+
<name>anchor</name><required>false</required><rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
<description>The character set used to encode the referenced page.
(HTML Pass-through)</description>
<name>charset</name><required>false</required><rtexprvalue>true</rtexprvalue>
</attribute>
@@ -1898,6 +1906,14 @@
</attribute>
<attribute>
<description>
+ The (optional) anchor that is appended at the end of the
generated URL.
+ If the URL specified by the value attribute already contains
the anchor then
+ the anchor specified by this attribute takes precedence.
+ </description>
+
<name>anchor</name><required>false</required><rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
+ <description>
Indicates if the application context path should be included
at the beginning of
the generated URL.
</description>
Modified:
branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/LinkTagSupport.java
===================================================================
--- branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/LinkTagSupport.java
2008-10-21 14:53:30 UTC (rev 983)
+++ branches/1.5.x/stripes/src/net/sourceforge/stripes/tag/LinkTagSupport.java
2008-10-21 14:55:16 UTC (rev 984)
@@ -37,6 +37,7 @@
private String event;
private Object beanclass;
private String url;
+ private String anchor;
private boolean addSourcePage = false;
private boolean prependContext = true;
@@ -103,6 +104,26 @@
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 <code>setUrl</code> 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
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development