Stapler.getCurrentRequest()For example, if the requested URL is "foo/bar/zot/abc?def=ghi" and "foo/bar" portion matched bar.jsp, this method returns "/zot/abc".
If this method is invoked from getters or
during the object traversal, this method returns the path portion
that is not yet processed.
StaplerProxy.getTarget()
getRestOfPath() but in the pre-decoded form,
so all "%HH"s as present in the request URL is intact.
javax.servlet.RequestDispatcher that represents a specific view
for the given object.
This support both JSP and Jelly.
viewName
If this name is relative name like "foo.jsp" or "bar/zot.jelly",
then the corresponding "side file" is searched by this name.
For Jelly, this also accepts absolute path name that starts with '/', such as "/foo/bar/zot.jelly". In this case, it.getClass().getClassLoader() is searched for this script.
javax.servlet.RequestDispatcher that represents a specific view
for the given class.
Unlike , calling this request dispatcher
doesn't set the "it" variable, so
getView(java.lang.Object,java.lang.String)getView(it.getClass(),viewName) and getView(it,viewName)
aren't the same thing.
Ancestor objects sorted in the
order from root to the "it" object.
For example, if the URL was "foo/bar/zot" and the "it" object
was determined as root.getFoo().getBar("zot"),
then this list will contain the following 3 objects in this order:
Ancestors. Can be empty, but always non-null.This method can behave in three ways.
javax.servlet.http.HttpServletResponse.SC_NOT_MODIFIED as the response code
and returns true.
This method sends out the "Expires" header to force browser to re-validate all the time.
timestampOfResource
The time stamp of the resource.rsp
This object is updated accordingly to simplify processing.javax.servlet.http.HttpServletResponse.SC_NOT_MODIFIED.expiration
The number of milliseconds until the resource will "expire".
Until it expires the browser will be allowed to cache it
and serve it without checking back with the server.
After it expires, the client will send conditional GET to
check if the resource is actually modified or not.
If 0, it will immediately expire.checkIfModified(long,org.kohsuke.stapler.StaplerResponse)
Values are converted into the right type. See .
org.apache.commons.beanutils.ConvertUtils.convert(java.lang.String,java.lang.Class)
bean
The object which will be filled out.org.apache.commons.beanutils.BeanUtils.setProperty(java.lang.Object,java.lang.String,java.lang.Object)bindParameters(java.lang.Object), but it performs a
pre-processing on property names. Namely, only property names that start
with the given prefix will be used for binding, and only the portion of the
property name after the prefix is used.
So for example, if the prefix is "foo.", then property name "foo.bar" with value
"zot" will invoke bean.setBar("zot").
This method works like and
bindParameters(java.lang.Object,java.lang.String), but it assumes
that form parameters have multiple-values, and use individual values to
fill in multiple beans.
bindParameters(java.lang.Class,java.lang.String)
For example, if getParameterValues("foo")=={"abc","def"} and getParameterValues("bar")=={"5","3"}, then this method will return two objects (the first with "abc" and "5", the second with "def" and "3".)
type
Type of the bean to be created. This class must have the default no-arg
constructor.prefix
See bindParameters(java.lang.Object,java.lang.String) for details.The given class must have a constructor annotated with '@stapler-constructor', and must be processed by the maven-stapler-plugin, so that the parameter names of the constructor is available at runtime.
The prefix is used to control the form parameter name. For example,
if the prefix is "foo." and if the constructor is define as
Foo(String a, String b), then the constructor will be invoked
as new Foo(getParameter("foo.a"),getParameter("foo.b")).
bindParameters(java.lang.Class,java.lang.String) but uses n-th value
of all the parameters.
This is useful for creating multiple instances from repeated form fields.
net.sf.json.JSONObject to the given target type,
by using introspection or constructor parameters injection.
For example, if you have a constructor that looks like the following:
class Foo {
@DataBoundConstructor
public Foo(Integer x, String y, boolean z, Bar bar) { ... }
}
class Bar {
@DataBoundConstructor
public Bar(int x, int y) {}
}
... and if JSONObject looks like
{ y:"text", z:true, bar:{x:1,y:2}}
then, this method returns
new Foo(null,"text",true,new Bar(1,2))
In the above example, a new instance of Bar was created, but you can also create a subtype of Bar by having the 'stapler-class' property in JSON like this:
class BarEx extends Bar {
@DataBoundConstructor
public BarEx(int a, int b, int c) {}
}
{ y:"text", z:true, bar: { stapler-class:"p.k.g.BarEx", a:1, b:2, c:3 } }
The type that shows up in the constructor (Bar in this case) can be an interface or an abstract class.
net.sf.json.JSONObject to the given object.
This method is bit like , except that this method
populates an existing object, instead of creating a new instance.
bindJSON(java.lang.Class,net.sf.json.JSONObject)
This method is also bit like , in that it
populates an existing object from a form submission, except that this method
obtains data from bindParameters(java.lang.Object,java.lang.String) thus more structured, whereas net.sf.json.JSONObject
uses the map structure of the form submission.
bindParameters(java.lang.Object,java.lang.String)
net.sf.json.JSONObject or net.sf.json.JSONArray to a list,
by using bindJSON(java.lang.Class,net.sf.json.JSONObject) as the lower-level mechanism.
If the source is , the returned list will contain
a single item. If it is net.sf.json.JSONObject, each item will be bound.
If it is null, then the list will be empty.
net.sf.json.JSONArray