VigilancyCourseGroupBean bean = (VigilancyCourseGroupBean) RenderUtils.getViewState( "addExternalCourse").getMetaObject().getObject(); ExecutionCourse course = bean.getAddExternalCourse();
IViewState viewState = (IViewState) RenderUtils.getViewState("addExternalCourse"); if(viewState==null) { viewState= (IViewState) RenderUtils.getViewState("addExternalCourse-withoutjs"); } VigilancyCourseGroupBean bean = (VigilancyCourseGroupBean) viewState.getMetaObject().getObject();  ExecutionCourse course = bean.getExternalCourse();
    public ActionForward addExternalCourse(ActionMapping mapping, ActionForm form,            HttpServletRequest request, HttpServletResponse response) throws Exception {        VigilancyCourseGroupBean bean = (VigilancyCourseGroupBean) RenderUtils.getViewState(                "addExternalCourse").getMetaObject().getObject();        ExecutionCourse course = bean.getAddExternalCourse();        VigilantGroup group = bean.getSelectedVigilantGroup();        List<ExecutionCourse> courses = new ArrayList<ExecutionCourse>();        courses.add(course);        try {            Object[] args = { group, courses };            executeService(request, "AddExecutionCourseToGroup", args);        } catch (DomainException e) {            addActionMessage(request, e.getMessage(), null);        }        request.setAttribute("bean", bean);        return mapping.findForward("editCourseGroup");    }