Package jenkins.util
Record Class ClientHttpRedirect
java.lang.Object
java.lang.Record
jenkins.util.ClientHttpRedirect
- All Implemented Interfaces:
org.kohsuke.stapler.HttpResponse
public record ClientHttpRedirect(String redirectUrl)
extends Record
implements org.kohsuke.stapler.HttpResponse
An HTTP response that redirects the client to the given URL.
Unlike
HttpRedirect, this implements a client-side redirect (using meta tag and/or JavaScript).
This allows the redirect to work even when Content Security Policy is enforced in Chrome
(which applies form-action to redirects after form submission).- Since:
- TODO
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionClientHttpRedirect(String redirectUrl) Creates an instance of aClientHttpRedirectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.voidgenerateResponse(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, Object o) final inthashCode()Returns a hash code value for this object.Returns the value of theredirectUrlrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.kohsuke.stapler.HttpResponse
generateResponse
-
Constructor Details
-
ClientHttpRedirect
Creates an instance of aClientHttpRedirectrecord class.- Parameters:
redirectUrl- the value for theredirectUrlrecord component
-
-
Method Details
-
generateResponse
public void generateResponse(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, Object o) throws IOException, jakarta.servlet.ServletException - Specified by:
generateResponsein interfaceorg.kohsuke.stapler.HttpResponse- Throws:
IOExceptionjakarta.servlet.ServletException
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
redirectUrl
Returns the value of theredirectUrlrecord component.- Returns:
- the value of the
redirectUrlrecord component
-