提交 1c6498f9 编写于 作者: M mindless

[FIXED HUDSON-7475] maintain ancestors if possible when forwarding to error page,

so nav links at top work properly


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@35270 71c3de6d-444a-0410-be80-ed276b4c234a
上级 7c35506b
/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi
* Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
......@@ -57,6 +57,9 @@ public class Failure extends RuntimeException implements HttpResponse {
req.setAttribute("message",getMessage());
if(pre)
req.setAttribute("pre",true);
rsp.forward( node instanceof AbstractModelObject ? node : Hudson.getInstance() ,"error",req);
if (node instanceof AbstractItem) // Maintain ancestors
rsp.forward(Hudson.getInstance(), ((AbstractItem)node).getUrl() + "error", req);
else
rsp.forward(node instanceof AbstractModelObject ? node : Hudson.getInstance() ,"error", req);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册