I have modified the verifyForwardPath method on Common.java ion the latest CVS version (1.13).
The reason i did this was because it didn't try to get the tiles forward path if it is an input path. Here is my modified verion of the method:
/**
* Verifies that ActionServlet used this logical forward or input mapping.
*
* @throws AssertionFailedError if expected and actual paths do not match.
*/
protected static void verifyForwardPath(ActionServlet actionServlet, String actionPath, String forwardName, String actualForwardPath, boolean isInputPath, HttpServletRequest request, ServletContext context, ServletConfig config) {
if ((forwardName == null) && (isInputPath)) {
forwardName = actionServlet.findMapping(actionPath).getInput();
if (forwardName == null)
throw new AssertionFailedError("no input mapping defined!");
}
if (!isInputPath) {
ActionForward expectedForward = actionServlet.findMapping(actionPath).findForward(forwardName);
if (expectedForward == null)
expectedForward = actionServlet.findForward(forwardName);
if (expectedForward == null)
throw new AssertionFailedError("Cannot find forward '" + forwardName + "' - it is possible that it is not mapped correctly.");
forwardName = expectedForward.getPath();
}
String tilesForward = getTilesForward(forwardName, request, context, config);
if (tilesForward != null)
forwardName = tilesForward;
forwardName = request.getContextPath() + forwardName;
if (!forwardName.equals(stripJSessionID(actualForwardPath)))
throw new AssertionFailedError("was expecting '" + forwardName + "' but received '" + actualForwardPath + "'");
}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I have modified the verifyForwardPath method on Common.java ion the latest CVS version (1.13).
The reason i did this was because it didn't try to get the tiles forward path if it is an input path. Here is my modified verion of the method:
/**
* Verifies that ActionServlet used this logical forward or input mapping.
*
* @throws AssertionFailedError if expected and actual paths do not match.
*/
protected static void verifyForwardPath(ActionServlet actionServlet, String actionPath, String forwardName, String actualForwardPath, boolean isInputPath, HttpServletRequest request, ServletContext context, ServletConfig config) {
if ((forwardName == null) && (isInputPath)) {
forwardName = actionServlet.findMapping(actionPath).getInput();
if (forwardName == null)
throw new AssertionFailedError("no input mapping defined!");
}
if (!isInputPath) {
ActionForward expectedForward = actionServlet.findMapping(actionPath).findForward(forwardName);
if (expectedForward == null)
expectedForward = actionServlet.findForward(forwardName);
if (expectedForward == null)
throw new AssertionFailedError("Cannot find forward '" + forwardName + "' - it is possible that it is not mapped correctly.");
forwardName = expectedForward.getPath();
}
String tilesForward = getTilesForward(forwardName, request, context, config);
if (tilesForward != null)
forwardName = tilesForward;
forwardName = request.getContextPath() + forwardName;
if (!forwardName.equals(stripJSessionID(actualForwardPath)))
throw new AssertionFailedError("was expecting '" + forwardName + "' but received '" + actualForwardPath + "'");
}