You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ec...@apache.org on 2008/03/12 22:56:03 UTC

svn commit: r636529 [15/15] - in /geronimo/samples/branches/1.0: ./ migration-ejb-bmp/ migration-ejb-bmp/dd/ migration-ejb-bmp/dd/META-INF/ migration-ejb-bmp/jndi/ migration-ejb-bmp/src/ migration-ejb-bmp/src/com/ migration-ejb-bmp/src/com/ibm/ migrati...

Added: geronimo/samples/branches/1.0/migration-webservices/web/index.jsp
URL: http://svn.apache.org/viewvc/geronimo/samples/branches/1.0/migration-webservices/web/index.jsp?rev=636529&view=auto
==============================================================================
--- geronimo/samples/branches/1.0/migration-webservices/web/index.jsp (added)
+++ geronimo/samples/branches/1.0/migration-webservices/web/index.jsp Wed Mar 12 14:54:41 2008
@@ -0,0 +1,103 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<%@ page language="java"
+    contentType="text/html; charset=utf-8"
+    pageEncoding="utf-8"
+    import="com.ibm.j2g.webservices.client.*"
+%>
+
+<%!
+    /* Name of the reference to the Search Phones service described in the web.xml file */
+    private final static String SERVICE_REF_NAME = "java:comp/env/service/SearchPhones";
+
+    /* Used for making hints to users */
+    private final static com.ibm.j2g.webservices.server.PersonPhone[] AVAILABLE_PHONES =
+        com.ibm.j2g.webservices.server.SearchPhonesServer.AVAILABLE_PHONES;
+
+    /* Returns the endpoint for calling methods of the web service */
+    public SearchPhonesPortType getService() throws Exception {
+        javax.naming.InitialContext ctx = new javax.naming.InitialContext();
+        SearchPhonesService service = (SearchPhonesService)ctx.lookup(SERVICE_REF_NAME);
+        return service.getSearchPhonesService();
+    }
+%>
+
+<%  String name = request.getParameter("name"); %>
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">     
+<html>
+
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <title>Web Services Application</title>
+</head>
+
+<body>
+    <h3>Search criterion</h3>
+    <form action="#">
+        <table>
+        <tr>
+            <td>Person name:</td>
+            <td><input type="text" name="name" value="<%=(name != null ? name : "")%>"/></td>
+        </tr>
+        <tr>
+            <td colspan="2"><input type="submit" value="Search"/></td>
+        </tr>
+        <tr>
+            <td colspan="2">
+                <br/>
+                Hint: the following names are hardcoded:<br/>
+
+                <% for (int i = 0; i < AVAILABLE_PHONES.length; i++) { %>
+                    <%=AVAILABLE_PHONES[i].getPersonName()%><%=(i < AVAILABLE_PHONES.length - 1 ? ", " : " ")%>
+                <% } %>
+  
+            </td>
+        </tr>
+        </table>
+    </form>
+
+<%  if (name != null && !name.equals("")) {
+        PersonPhone[] foundPhones = getService().search(name); %>
+
+        <br/>
+        <h3>Search results</h3>
+        <table >
+
+            <% if (foundPhones == null || foundPhones.length == 0) { %>
+                <tr><td>No persons which name starts with the specified criterion were found.</td></tr>
+
+            <% } else { %>
+                <tr><td colspan="2">The following persons and phones were found:</td></tr>
+
+                <% for (int i = 0; i < foundPhones.length; i++) { %>
+                <tr>
+                    <td><%=foundPhones[i].getPersonName()%></td>
+                    <td><%=foundPhones[i].getPhoneNumber()%></td>
+                </tr>
+                <% } %>
+
+            <% } %>
+
+        </table>
+
+<%  } %>
+
+</body>
+
+</html>

Propchange: geronimo/samples/branches/1.0/migration-webservices/web/index.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/samples/branches/1.0/migration-webservices/web/index.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/samples/branches/1.0/migration-webservices/web/index.jsp
------------------------------------------------------------------------------
    svn:mime-type = text/plain