Package org.apache.commons.workflow.web

Examples of org.apache.commons.workflow.web.WebContext


    protected WebContext getContext(ActionMapping mapping,
            HttpServletRequest request, HttpServletResponse response) {

        String contextId = mapping.getParameter();
        HttpSession session = request.getSession();
        WebContext context = (WebContext)
            session.getAttribute(contextId);
        if (context == null) {
            if (doDebugLog())
                servlet.log("{" + session.getId() + "} Creating new Context");
            context = new WebContext();
            // context.setActivity(getActivity(contextId));
            context.setActivity(activity);
            context.setHttpSession(session);
            context.setServletContext(servlet.getServletContext());
            if (doDebugListener())
                context.addContextListener(this);
            session.setAttribute(contextId, context);
            context.call(context.getActivity());
        }
        return context;

    }
View Full Code Here


                 HttpServletResponse response)
    throws IOException, ServletException {

        ActionErrors errors = new ActionErrors();

        WebContext context = getContext(mapping,request,
            response);

        Activity activity = getActivity(mapping);

        validateInit(errors,context,activity);
View Full Code Here

     *
     * @param event The <code>ContextEvent</code> that has occurred
     */
    public void afterActivity(ContextEvent event) {

        WebContext context = (WebContext) event.getContext();
        HttpSession session = context.getHttpSession();
        StringBuffer sb = new StringBuffer("{");
        sb.append(session.getId());
        sb.append("} afterActivity");
        servlet.log(sb.toString());

View Full Code Here

     *
     * @param event The <code>ContextEvent</code> that has occurred
     */
    public void afterStep(ContextEvent event) {

        WebContext context = (WebContext) event.getContext();
        HttpSession session = context.getHttpSession();
        StringBuffer sb = new StringBuffer("{");
        sb.append(session.getId());
        sb.append("} afterStep ");
        sb.append(event.getStep());
        if (context.getSuspend())
            sb.append(" (Suspended)");
        if (context.getNextStep() == null)
            sb.append(" (Finished)");
        servlet.log(sb.toString());
        if (event.getException() != null)
            servlet.log("-->Step threw exception", event.getException());

View Full Code Here

     *
     * @param event The <code>ContextEvent</code> that has occurred
     */
    public void beforeActivity(ContextEvent event) {

        WebContext context = (WebContext) event.getContext();
        HttpSession session = context.getHttpSession();
        StringBuffer sb = new StringBuffer("{");
        sb.append(session.getId());
        sb.append("} beforeActivity");
        servlet.log(sb.toString());

View Full Code Here

     *
     * @param event The <code>ContextEvent</code> that has occurred
     */
    public void beforeStep(ContextEvent event) {

        WebContext context = (WebContext) event.getContext();
        HttpSession session = context.getHttpSession();
        StringBuffer sb = new StringBuffer("{");
        sb.append(session.getId());
        sb.append("} beforeStep ");
        sb.append(event.getStep());
        servlet.log(sb.toString());
View Full Code Here

    protected WebContext getContext(ActionMapping mapping,
            HttpServletRequest request, HttpServletResponse response) {

        String contextId = mapping.getParameter();
        HttpSession session = request.getSession();
        WebContext context = (WebContext)
            session.getAttribute(contextId);
        if (context == null) {
            if (doDebugLog())
                servlet.log("{" + session.getId() + "} Creating new Context");
            context = new WebContext();
            // context.setActivity(getActivity(contextId));
            context.setActivity(activity);
            context.setHttpSession(session);
            context.setServletContext(servlet.getServletContext());
            if (doDebugListener())
                context.addContextListener(this);
            session.setAttribute(contextId, context);
            context.call(context.getActivity());
        }
        return context;

    }
View Full Code Here

                 HttpServletResponse response)
    throws Exception {

        ActionErrors errors = new ActionErrors();

        WebContext context = getContext(mapping,request,
            response);

        Activity activity = getActivity(mapping);

        validateInit(errors,context,activity);
View Full Code Here

     *
     * @param event The <code>ContextEvent</code> that has occurred
     */
    public void afterActivity(ContextEvent event) {

        WebContext context = (WebContext) event.getContext();
        HttpSession session = context.getHttpSession();
        StringBuffer sb = new StringBuffer("{");
        sb.append(session.getId());
        sb.append("} afterActivity");
        servlet.log(sb.toString());

View Full Code Here

     *
     * @param event The <code>ContextEvent</code> that has occurred
     */
    public void afterStep(ContextEvent event) {

        WebContext context = (WebContext) event.getContext();
        HttpSession session = context.getHttpSession();
        StringBuffer sb = new StringBuffer("{");
        sb.append(session.getId());
        sb.append("} afterStep ");
        sb.append(event.getStep());
        if (context.getSuspend())
            sb.append(" (Suspended)");
        if (context.getNextStep() == null)
            sb.append(" (Finished)");
        servlet.log(sb.toString());
        if (event.getException() != null)
            servlet.log("-->Step threw exception", event.getException());

View Full Code Here

TOP

Related Classes of org.apache.commons.workflow.web.WebContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.