package org.flymine.web;

/*
 * Copyright (C) 2002-2003 FlyMine
 *
 * This code may be freely distributed and modified under the
 * terms of the GNU Lesser General Public Licence.  This should
 * be distributed with the code.  See the LICENSE file for more
 * information or http://www.gnu.org/copyleft/lesser.html.
 *
 */

import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

/**
 * Implementation of <strong>Action</strong> that removes a Query from a session.
 *
 * @author Richard Smith
 */

public class RestartQueryAction extends Action
{

    /**
     * Process the specified HTTP request, and create the corresponding HTTP
     * response (or forward to another web component that will create it).
     * Return an <code>ActionForward</code> instance describing where and how
     * control should be forwarded, or <code>null</code> if the response has
     * already been completed.
     *
     * @param mapping The ActionMapping used to select this instance
     * @param form The optional ActionForm bean for this request (if any)
     * @param request The HTTP request we are processing
     * @param response The HTTP response we are creating
     * @return an ActionForward object defining where control goes next
     *
     * @exception Exception if the application business logic throws
     *  an exception
     */
    public ActionForward execute(ActionMapping mapping,
                                 ActionForm form,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
        throws Exception {

        HttpSession session = request.getSession();
        session.removeAttribute("query");
        session.removeAttribute("queryClass");
        session.removeAttribute("ops");
        session.removeAttribute("constraints");

        return (mapping.findForward("buildquery"));
    }
}

@@ -747,17 +747,16 @@
 ith%0A */%0A
-%0A
 public c
@@ -796,17 +796,16 @@
 ction%0A%7B%0A
-%0A
     /**%0A
@@ -1840,17 +1840,16 @@
 ption %7B%0A
-%0A
         
@@ -1896,49 +1896,8 @@
 ();%0A
-        session.removeAttribute(%22query%22);
 %0A   
@@ -1936,16 +1936,18 @@
 eryClass
+es
 %22);%0A    
@@ -1979,58 +1979,19 @@
 te(%22
-ops%22);%0A        session.removeAttribute(%22constraint
+editingAlia
 s%22);
@@ -2007,17 +2007,16 @@
  return 
-(
 mapping.
@@ -2040,17 +2040,16 @@
 dquery%22)
-)
 ;%0A    %7D%0A

Change to reflect way query is stored in the session