You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in the context of Jenkins I had a method being called by Stapler that I was forwarding on to another view by calling response.forward(this, "feedback", request)
However in doing that the breadcrumb bar in Jenkins broke.
This seems to caused by ResponseImpl.forward calling stapler.invoke which sets an empty AncestorList.
Because the ancestorList is empty the breadCrumbs are also empty.
if I manually navigated to the path ezposed by this and then added "/feedback" to the path the breadcrumbs and hence the ancestor list is correctly computed and shown.
It is suprising to me that forward takes an Object and a relative "view" but using anything other than the root and a full "path/to/view" causes unexpected behaviour.
potential fix is to instead use something akin to resp.forward(Jenkins.get(), user.getUrl() + "/" + getUrlName() + "/feedback", req); which is ugly.
Also of note that req.getView(this, "theView").forward(req,resp) does work for this use case, so it is unclear why the first method does not work in this case, and I believe that it should.
in the context of Jenkins I had a method being called by Stapler that I was forwarding on to another view by calling
response.forward(this, "feedback", request)
However in doing that the breadcrumb bar in Jenkins broke.
This seems to caused by
ResponseImpl.forward
callingstapler.invoke
which sets an emptyAncestorList
.Because the
ancestorList
is empty the breadCrumbs are also empty.if I manually navigated to the path ezposed by
this
and then added "/feedback" to the path the breadcrumbs and hence theancestor
list is correctly computed and shown.It is suprising to me that
forward
takes an Object and a relative "view" but using anything other than the root and a full "path/to/view" causes unexpected behaviour.potential fix is to instead use something akin to
resp.forward(Jenkins.get(), user.getUrl() + "/" + getUrlName() + "/feedback", req);
which is ugly.Also of note that
req.getView(this, "theView").forward(req,resp)
does work for this use case, so it is unclear why the first method does not work in this case, and I believe that it should.summary
behaves differently to
(when given the same object and a path without a slash)
yet reading the javadoc they should be logically identical (and both should have the behaviour of
request.getView(...).forward(...)
The text was updated successfully, but these errors were encountered: