Project

General

Profile

1
<%@ page    language="java" %>
2
<%
3
/**
4
 *  '$RCSfile$'
5
 *    Copyright: 2000 Regents of the University of California and the
6
 *               National Center for Ecological Analysis and Synthesis
7
 *  For Details: http://www.nceas.ucsb.edu/
8
 *
9
 *   '$Author: tao $'
10
 *     '$Date: 2010-05-25 17:15:51 -0700 (Tue, 25 May 2010) $'
11
 * '$Revision: 5372 $'
12
 *
13
 * This program is free software; you can redistribute it and/or modify
14
 * it under the terms of the GNU General Public License as published by
15
 * the Free Software Foundation; either version 2 of the License, or
16
 * (at your option) any later version.
17
 *
18
 * This program is distributed in the hope that it will be useful,
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
 * GNU General Public License for more details.
22
 *
23
 * You should have received a copy of the GNU General Public License
24
 * along with this program; if not, write to the Free Software
25
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
 */
27
 %>
28

    
29
 <%@ include file="../../common/common-settings.jsp"%>
30

    
31
 <% 
32
/**
33
 *  Does a redirect to knb homepage at KNB_SITE_URL
34
 */
35

    
36
       java.util.Properties params = new java.util.Properties();
37
       java.util.Enumeration paramlist = request.getParameterNames();
38

    
39
       String userName = null;
40
       String organization = null;
41
       String password = null;
42

    
43
       while (paramlist.hasMoreElements()) {
44
          String name = (String) paramlist.nextElement();
45
          String[] value = request.getParameterValues(name);
46
            params.put(name, value[0]);
47
       }
48

    
49
       String reply = null;
50
       try{
51

    
52
         java.net.URL url = new java.net.URL(KNB_SITE_URL + "/index.jsp");
53
         edu.ucsb.nceas.utilities.HttpMessage msg =
54
                            new edu.ucsb.nceas.utilities.HttpMessage(url);
55
         java.io.InputStream returnStrea = msg.sendPostData(params);
56
         java.io.InputStreamReader returnStream =
57
                            new java.io.InputStreamReader(returnStrea);
58
         java.io.StringWriter sw = new java.io.StringWriter();
59
         int len;
60
         char[] characters = new char[512];
61
         while ((len = returnStream.read(characters, 0, 512)) != -1) {
62
                sw.write(characters, 0, len);
63
         }
64
         returnStream.close();
65
         reply = sw.toString();
66
         sw.close();
67
      } catch(Exception e){
68
         response.sendRedirect(KNB_SITE_URL);
69
      }
70
%>
71
<%=reply%>
72

    
(3-3/9)