jodd-madvoc/src/main/java/jodd/madvoc/component/ResultsManager.java
public ActionResult lookup(final ActionRequest actionRequest, final Object resultObject) {

		ActionResult actionResultHandler = null;

		// + read @RenderWith value on method
		{
			final ActionRuntime actionRuntime = actionRequest.getActionRuntime();

			final Class<? extends ActionResult> actionResultClass = actionRuntime.getActionResult();

			if (actionResultClass != null) {
				actionResultHandler = lookupAndRegisterIfMissing(actionResultClass);
			}
		}

		// + use @RenderWith value on resulting object if exist
		if (actionResultHandler == null && resultObject != null) {
			final RenderWith renderWith = resultObject.getClass().getAnnotation(RenderWith.class);

			if (renderWith != null) {
				actionResultHandler = lookupAndRegisterIfMissing(renderWith.value());
			}
			else if (resultObject instanceof ActionResult) {
				// special case - returned value is already the ActionResult
				actionResultHandler = (ActionResult) resultObject;
			}
		}

		// + use action configuration
		if (actionResultHandler == null) {
			final ActionRuntime actionRuntime = actionRequest.getActionRuntime();

			final Class<? extends ActionResult> actionResultClass = actionRuntime.getDefaultActionResult();

			if (actionResultClass != null) {
				actionResultHandler = lookupAndRegisterIfMissing(actionResultClass);
			}
		}

		if (actionResultHandler == null) {
			throw new MadvocException("ActionResult not found for: " + resultObject);
		}

		// set action result object into action request!
		actionRequest.bindActionResult(resultObject);

		return actionResultHandler;
	}
public ActionResult lookup(final ActionRequest actionRequest, final Object resultObject) {

		ActionResult actionResultHandler = null;

		// + read @RenderWith value on method
		{
			final ActionRuntime actionRuntime = actionRequest.getActionRuntime();

			final Class<? extends ActionResult> actionResultClass = actionRuntime.getActionResult();

			if (actionResultClass != null) {
				actionResultHandler = lookupAndRegisterIfMissing(actionResultClass);
			}
		}

		// + use @RenderWith value on resulting object if exist
		if (actionResultHandler == null && resultObject != null) {
			final RenderWith renderWith = resultObject.getClass().getAnnotation(RenderWith.class);

			if (renderWith != null) {
				actionResultHandler = lookupAndRegisterIfMissing(renderWith.value());
			}
			else if (resultObject instanceof ActionResult) {
				// special case - returned value is already the ActionResult
				actionResultHandler = (ActionResult) resultObject;
			}
		}

		// + use action configuration
		if (actionResultHandler == null) {
			final ActionRuntime actionRuntime = actionRequest.getActionRuntime();

			final Class<? extends ActionResult> actionResultClass = actionRuntime.getDefaultActionResult();

			if (actionResultClass != null) {
				actionResultHandler = lookupAndRegisterIfMissing(actionResultClass);
			}
		}

		if (actionResultHandler == null) {
			throw new MadvocException("ActionResult not found for: " + resultObject);
		}

		// set action result object into action request!
		actionRequest.bindActionResult(resultObject);

		return actionResultHandler;
	}
Lookups for {@link jodd.madvoc.result.ActionResult action result handler}
based on current {@link jodd.madvoc.ActionRequest action request} and action method
result object.