Project

General

Profile

1
<!--
2
  *   '$RCSfile$'
3
  *   '$Author: harris $'
4
  *   '$Date: 2005-10-18 13:48:23 -0700 (Tue, 18 Oct 2005) $'
5
  *   '$Revision: 2678 $'
6
  *
7
  *
8
  * This program is free software; you can redistribute it and/or modify
9
  * it under the terms of the GNU General Public License as published by
10
  * the Free Software Foundation; either version 2 of the License, or
11
  * (at your option) any later version.
12
  *
13
  * This program is distributed in the hope that it will be useful,
14
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
  * GNU General Public License for more details.
17
  *
18
  * You should have received a copy of the GNU General Public License
19
  * along with this program; if not, write to the Free Software
20
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21
-->
22

    
23
<%@ page import="org.apache.tools.mail.MailMessage" %>
24
<%@ page import="java.io.PrintStream" %>
25
<%@ page import="java.io.BufferedReader" %>
26
<%@ page import="java.util.StringTokenizer" %>
27
<%@ page import="java.io.InputStreamReader" %>
28
<%@ page import="java.net.URLConnection" %>
29
<%@ page import="java.net.URL" %>
30

    
31

    
32
<%
33
    System.out.println("********************************************************");
34
    System.out.println("********************************************************");
35
    System.out.println("**************** metacat_spatialresolver.jsp*****************\n");
36
    
37

    
38
     String _request = request.getParameter("REQUEST");
39
     _request = (_request!=null)? _request.trim() : "";
40
  
41
  	System.out.println("uri: " + request.getRequestURI());
42
	  System.out.println("request string: " + request.getQueryString());
43
					   
44
					   
45
	//URLConnection _conn = new URLConnection("http://geonumericsolutions.com");
46
	URL url = new URL("http://nebulous.msi.ucsb.edu:8080/geoserver/wms?"+request.getQueryString());
47
	URLConnection c = url.openConnection();
48
	BufferedReader in = new BufferedReader(
49
                                new InputStreamReader(
50
                                c.getInputStream()));
51
        String inputLine;
52

    
53
        while ((inputLine = in.readLine()) != null) 
54
            
55
			if ( inputLine.startsWith("url") ) {
56
				
57
				StringTokenizer _st = new StringTokenizer(inputLine, " ");
58
				_st.nextToken(); // url string
59
				_st.nextToken(); // equals sign
60
				String _redirectTo = _st.nextToken();
61
				System.out.println("redirecting to: " + _redirectTo); 
62
				response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
63
				String newLocn = _redirectTo;
64
				response.setHeader("Location",newLocn);
65
			}
66
        in.close();
67
	
68
  
69
%>
70

    
71
<html>
72
<head>
73
<title>Metacat Spatial Resolver</title>
74
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
75
<link href="styles.css" rel="stylesheet" type="text/css">
76
</head>
77

    
78
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="images/blue_pixel_bg.jpg">
79
<table width="100%" border="0" cellspacing="0" cellpadding="0">
80
  <!--DWLayoutTable-->
81
  <tr>
82
          <td  width="700" height="20" background="images/blue_pixel_bg.jpg"></td>
83

    
84
  </tr>
85
    
86
 
87
  
88
  
89
  <tr> 
90
    <td bgcolor="#6699CC"> <table width="700" border="0" cellspacing="0" cellpadding="0">
91
        <tr> 
92
          <td>&nbsp;</td>
93
          <td><td>&nbsp;</td>
94
        </tr>
95
      </table>
96
  </tr>
97
</table>
98
</body>
99
</html>
100

    
    (1-1/1)