Project

General

Profile

1
/**
2
 * This work was created by participants in the DataONE project, and is
3
 * jointly copyrighted by participating institutions in DataONE. For 
4
 * more information on DataONE, see our web site at http://dataone.org.
5
 *
6
 *   Copyright ${year}
7
 *
8
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 * you may not use this file except in compliance with the License.
10
 * You may obtain a copy of the License at
11
 *
12
 *   http://www.apache.org/licenses/LICENSE-2.0
13
 *
14
 * Unless required by applicable law or agreed to in writing, software
15
 * distributed under the License is distributed on an "AS IS" BASIS,
16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
 * See the License for the specific language governing permissions and 
18
 * limitations under the License.
19
 * 
20
 * $Id: FailureServlet.java 7737 2013-05-22 06:05:30Z leinfelder $
21
 */
22

    
23
package edu.ucsb.nceas.metacat.portal;
24

    
25
import javax.servlet.http.HttpServletRequest;
26
import javax.servlet.http.HttpServletResponse;
27

    
28
import edu.uiuc.ncsa.myproxy.oa4mp.client.servlet.ClientServlet;
29

    
30
import java.io.PrintWriter;
31

    
32
/**
33
 * <p>Created by Jeff Gaynor<br>
34
 * on Aug 11, 2010 at  10:11:13 AM
35
 */
36
public class FailureServlet extends ClientServlet {
37
    protected void doIt(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Throwable {
38
        clearCookie(httpServletRequest, httpServletResponse); // clear out old session info
39
        httpServletResponse.setContentType("text/html");
40
        PrintWriter printWriter = httpServletResponse.getWriter();
41
        printWriter.println("<html>\n" +
42
                "<head><title>Failure</title></head>\n" +
43
                "<body><h1>Uh-oh...</h1>" +
44
                "<p>There was an error processing your request.</p>" +
45
                "<form name=\"input\" action=\"");
46
        printWriter.println(httpServletRequest.getContextPath() + "/\" method=\"get\">");
47
        printWriter.println("Click to go back to the main page<br><br>\n" +
48
                "<input type=\"submit\" value=\"Submit\" />\n" +
49
                "</form>\n" +
50
                "  </body>\n" +
51
                "</html>");
52
    }
53
}
(1-1/3)