Skip to content

Commit

Permalink
The BlockContext wasn't pushed at the BlockCallStack when doing a pol…
Browse files Browse the repository at this point in the history
…ymorphic call through the block protocol (e.g. block:/foo), this made subsequent block protocol call be called relative to the wrong context. This hopefully fixes the problem reported in JIRA issue COCOON-1939.

git-svn-id: https://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-blocks-fw@468664 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Par Daniel Fagerstrohm committed Oct 28, 2006
1 parent 3c36e08 commit 842e096
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Expand Up @@ -433,7 +433,12 @@ private boolean exists() {
*/
public void forward(ServletRequest request, ServletResponse response)
throws ServletException, IOException {
BlockContext.this.servlet.service(request, response);
try {
BlockCallStack.enterBlock(BlockContext.this);
BlockContext.this.servlet.service(request, response);
} finally {
BlockCallStack.leaveBlock();
}
}

/* (non-Javadoc)
Expand Down
Expand Up @@ -120,12 +120,7 @@ protected void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
RequestDispatcher dispatcher =
this.blockContext.getRequestDispatcher(request.getPathInfo());
try {
BlockCallStack.enterBlock(this.blockContext);
dispatcher.forward(request, response);
} finally {
BlockCallStack.leaveBlock();
}
dispatcher.forward(request, response);
}

/**
Expand Down

0 comments on commit 842e096

Please sign in to comment.