Class Dialogs
data-type="dialog-opener" with
data-dialog-url, the mechanism of core's "Create User" and build-parameters dialogs).
Core's dialog loads the URL, shows the first <form> of the answer and submits it with
the crumb header; a redirect answer is followed by the whole page (to the new request), any
other answer that holds a form replaces the dialog's form. A dialog form therefore carries the
hidden field "dialog", and a refused submission is answered with the dialog view, not
the full page. The field only selects which view shows the refusal: every check is the same.
D-72: a dialog form may also carry the marker in its action's query string
(?dialog=true), so that a submission refused before its body is read (over the body
size cap) can still be answered with the dialog view: fromDialogQuery(jakarta.servlet.http.HttpServletRequest) reads the query
string alone and never the body.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanfromDialog(org.kohsuke.stapler.StaplerRequest2 req) Whetherreqwas submitted from a dialog form.static booleanfromDialogQuery(jakarta.servlet.http.HttpServletRequest req) Whether the query string ofreq(never its body) marks a dialog submission (dialog=true).static StringrefusalView(org.kohsuke.stapler.StaplerRequest2 req, String pageView) The view that shows a refusal ofreq: the dialog's, elsepageView.static String../once per path segment of an item URL (job/a/job/b/), the way from the item's page back to the Jenkins root (which carries the context path, if any).
-
Field Details
-
PARAMETER
Hidden form field marking a submission made from a dialog.- See Also:
-
DIALOG_VIEW
View name of the dialog form of a screen.- See Also:
-
-
Method Details
-
fromDialog
public static boolean fromDialog(@CheckForNull org.kohsuke.stapler.StaplerRequest2 req) Whetherreqwas submitted from a dialog form. -
fromDialogQuery
public static boolean fromDialogQuery(@CheckForNull jakarta.servlet.http.HttpServletRequest req) Whether the query string ofreq(never its body) marks a dialog submission (dialog=true). For a refusal made before the body may be read (D-72 size cap):getParameterwould parse a multipart body. -
refusalView
public static String refusalView(@CheckForNull org.kohsuke.stapler.StaplerRequest2 req, String pageView) The view that shows a refusal ofreq: the dialog's, elsepageView. -
toRoot
../once per path segment of an item URL (job/a/job/b/), the way from the item's page back to the Jenkins root (which carries the context path, if any).
-