提交 a7416b9e 编写于 作者: K kohsuke

added the code to handle structured form data.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4967 71c3de6d-444a-0410-be80-ed276b4c234a
上级 c9f5e677
......@@ -360,6 +360,12 @@
<artifactId>txw2</artifactId>
<version>20070624</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.0</version>
<classifier>jdk15</classifier>
</dependency>
</dependencies>
</project>
package hudson;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;
/**
* Obtains the structured form data from {@link StaplerRequest}.
* See http://hudson.gotdns.com/wiki/display/HUDSON/Structured+Form+Submission
*
* @author Kohsuke Kawaguchi
*/
public class StructuredForm {
public static JSONObject get(StaplerRequest req) {
JSONObject o = (JSONObject)req.getAttribute(StructuredForm.class.getName());
if(o==null) {
o = JSONObject.fromObject(req.getParameter("json"));
req.setAttribute(StructuredForm.class.getName(),o);
}
return o;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册