提交 2aeda6cc 编写于 作者: K kohsuke

integrated a newer Jelly and Stapler that runs faster with less memory

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@27308 71c3de6d-444a-0410-be80-ed276b4c234a
上级 0478efb6
......@@ -333,7 +333,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.kohsuke.stapler</groupId>
<artifactId>stapler-jelly</artifactId>
<version>1.132</version>
<version>1.133</version>
<exclusions>
<exclusion>
<groupId>commons-jelly</groupId>
......@@ -555,7 +555,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jvnet.hudson</groupId>
<artifactId>commons-jelly</artifactId>
<version>1.1-hudson-20100114</version>
<version>1.1-hudson-20100210</version>
</dependency>
<dependency>
<groupId>org.acegisecurity</groupId>
......
......@@ -77,7 +77,6 @@ import org.kohsuke.stapler.Ancestor;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.jelly.CustomTagLibrary.StaplerDynamicTag;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
......@@ -1100,24 +1099,6 @@ public class Functions {
return Cloud.all();
}
/**
* Used to assist form databinding. Given the "attrs" object,
* find the ancestor tag file of the given name.
*/
public Tag findAncestorTag(Map attributes, String nsUri, String local) {
Tag tag = (Tag) attributes.get("ownerTag");
if(tag==null) return null;
while(true) {
tag = TagSupport.findAncestorWithClass(tag.getParent(), StaplerDynamicTag.class);
if(tag==null)
return null;
StaplerDynamicTag stag = (StaplerDynamicTag)tag;
if(stag.getLocalName().equals(local) && stag.getNsUri().equals(nsUri))
return tag;
}
}
/**
* Prepend a prefix only when there's the specified body.
*/
......
......@@ -61,6 +61,8 @@ THE SOFTWARE.
<j:set target="${attrs}" property="help"
value="${descriptor.getHelpFile(attrs.field)}" />
</j:if>
<!-- expose this so that we can look up the @field value later from prepareDatabinding.jelly -->
<j:set var="entry" value="${attrs}" />
<tr>
<td class="setting-leftspace"><st:nbsp/></td>
<td class="setting-name">
......
......@@ -29,8 +29,8 @@ THE SOFTWARE.
</st:documentation>
<j:set var="pattrs" value="${parentScope.attrs}" />
<j:if test="${pattrs.field==null}">
<j:set target="${pattrs}" property="field"
value="${h.findAncestorTag(pattrs,'/lib/form','entry').attributes.field}" />
<!-- this looks up the ancestor <entry> set by entry.jelly -->
<j:set target="${pattrs}" property="field" value="${entry.field}" />
</j:if>
<j:set target="${pattrs}" property="checkUrl"
value="${h.getCheckUrl(pattrs.checkUrl,descriptor,pattrs.field)}" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册