Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2013-01-18 12:17:04 -0500
committerGlyn Normington2013-01-18 12:17:04 -0500
commit350b37d13991a28b264b61f73e73ff49616de635 (patch)
treec98becf2dfc8e862f7bed7dcc4b5b93c8df7782b
parent6c42bd6d8c8dc86151b6ae09b52a6fe11a505097 (diff)
downloadorg.eclipse.virgo.samples-350b37d13991a28b264b61f73e73ff49616de635.tar.gz
org.eclipse.virgo.samples-350b37d13991a28b264b61f73e73ff49616de635.tar.xz
org.eclipse.virgo.samples-350b37d13991a28b264b61f73e73ff49616de635.zip
next attempt
-rw-r--r--REST/org.eclipse.virgo.samples.rest/.classpath8
-rw-r--r--REST/org.eclipse.virgo.samples.rest/.settings/org.eclipse.wst.common.project.facet.core.xml1
-rw-r--r--REST/org.eclipse.virgo.samples.rest/src/main/java/org/eclipse/virgo/samples/rest/RestController.java8
-rw-r--r--REST/org.eclipse.virgo.samples.rest/src/main/webapp/META-INF/MANIFEST.MF2
-rw-r--r--REST/org.eclipse.virgo.samples.rest/src/main/webapp/WEB-INF/jsp/roy.jsp74
-rw-r--r--REST/org.eclipse.virgo.samples.rest/src/main/webapp/WEB-INF/rest-servlet.xml (renamed from REST/org.eclipse.virgo.samples.rest/src/main/webapp/WEB-INF/sample-servlet.xml)10
-rw-r--r--REST/org.eclipse.virgo.samples.rest/src/main/webapp/WEB-INF/web.xml9
-rw-r--r--REST/org.eclipse.virgo.samples.rest/src/main/webapp/index.html5
8 files changed, 103 insertions, 14 deletions
diff --git a/REST/org.eclipse.virgo.samples.rest/.classpath b/REST/org.eclipse.virgo.samples.rest/.classpath
index 870b2b8..9b77339 100644
--- a/REST/org.eclipse.virgo.samples.rest/.classpath
+++ b/REST/org.eclipse.virgo.samples.rest/.classpath
@@ -8,7 +8,7 @@
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="var" path="IVY_CACHE/org.springframework/org.springframework.web/3.1.0.RELEASE/org.springframework.web-3.1.0.RELEASE.jar" sourcepath="/IVY_CACHE/org.springframework/org.springframework.web/3.0.0.RELEASE/org.springframework.web-sources-3.0.0.RELEASE.jar"/>
<classpathentry kind="var" path="IVY_CACHE/org.springframework/org.springframework.beans/3.1.0.RELEASE/org.springframework.beans-3.1.0.RELEASE.jar"/>
- <classpathentry kind="var" path="IVY_CACHE/org.springframework/org.springframework.web.servlet/3.1.0.RELEASE/org.springframework.web.servlet-3.1.0.RELEASE.jar" sourcepath="/IVY_CACHE/org.springframework/org.springframework.web.servlet/3.0.0.RELEASE/org.springframework.web.servlet-sources-3.0.0.RELEASE.jar"/>
+ <classpathentry kind="var" path="IVY_CACHE/org.springframework/org.springframework.web.servlet/3.1.0.RELEASE/org.springframework.web.servlet-3.1.0.RELEASE.jar" sourcepath="/IVY_CACHE/org.springframework/org.springframework.web.servlet/3.1.0.RELEASE/org.springframework.web.servlet-sources-3.1.0.RELEASE.jar"/>
<classpathentry kind="var" path="IVY_CACHE/org.eclipse.virgo.mirrored/javax.servlet/3.0.0.v201112011016/javax.servlet-3.0.0.v201112011016.jar" sourcepath="/IVY_CACHE/javax.servlet/com.springsource.javax.servlet/3.0.0.v201112011016/com.springsource.javax.servlet-sources-3.0.0.v201112011016.jar"/>
<classpathentry kind="var" path="IVY_CACHE/org.springframework/org.springframework.context/3.1.0.RELEASE/org.springframework.context-3.1.0.RELEASE.jar" sourcepath="/IVY_CACHE/org.springframework/org.springframework.context/3.0.0.RELEASE/org.springframework.context-sources-3.0.0.RELEASE.jar"/>
<classpathentry kind="var" path="IVY_CACHE/org.eclipse.virgo.mirrored/javax.servlet.jsp/2.2.0.v201112011158/javax.servlet.jsp-2.2.0.v201112011158.jar"/>
@@ -18,6 +18,10 @@
<classpathentry kind="var" path="IVY_CACHE/org.apache.taglibs/com.springsource.org.apache.taglibs.standard/1.1.2/com.springsource.org.apache.taglibs.standard-1.1.2.jar"/>
<classpathentry kind="var" path="IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.7.1.R37x_v20110808-1106/org.eclipse.osgi-3.7.1.R37x_v20110808-1106.jar" sourcepath="/IVY_CACHE/org.eclipse.osgi/org.eclipse.osgi/3.6.1.R36x_v20100806/org.eclipse.osgi-sources-3.6.1.R36x_v20100806.jar"/>
<classpathentry kind="var" path="IVY_CACHE/org.eclipse.virgo.mirrored/org.eclipse.equinox.cm/1.0.400.v20120319-2029/org.eclipse.equinox.cm-1.0.400.v20120319-2029.jar" sourcepath="/IVY_CACHE/org.apache.felix/org.apache.felix.configadmin/1.2.4/org.apache.felix.configadmin-sources-1.2.4.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.launching.macosx.MacOSXType/JVM 1.6.0 (MacOS X Default)">
+ <attributes>
+ <attribute name="owner.project.facets" value="java"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
diff --git a/REST/org.eclipse.virgo.samples.rest/.settings/org.eclipse.wst.common.project.facet.core.xml b/REST/org.eclipse.virgo.samples.rest/.settings/org.eclipse.wst.common.project.facet.core.xml
index 31e1d4d..1ccb66e 100644
--- a/REST/org.eclipse.virgo.samples.rest/.settings/org.eclipse.wst.common.project.facet.core.xml
+++ b/REST/org.eclipse.virgo.samples.rest/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
+ <runtime name="VTS 3.6.0"/>
<fixed facet="jst.web"/>
<fixed facet="jst.java"/>
<installed facet="jst.web" version="2.5"/>
diff --git a/REST/org.eclipse.virgo.samples.rest/src/main/java/org/eclipse/virgo/samples/rest/RestController.java b/REST/org.eclipse.virgo.samples.rest/src/main/java/org/eclipse/virgo/samples/rest/RestController.java
index 8c04862..feb7070 100644
--- a/REST/org.eclipse.virgo.samples.rest/src/main/java/org/eclipse/virgo/samples/rest/RestController.java
+++ b/REST/org.eclipse.virgo.samples.rest/src/main/java/org/eclipse/virgo/samples/rest/RestController.java
@@ -15,6 +15,7 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
/**
* <p>
@@ -27,12 +28,13 @@ import org.springframework.web.bind.annotation.RequestMethod;
*
*/
@Controller
-@RequestMapping("/users")
+//@RequestMapping("/rest/users")
public final class RestController {
- @RequestMapping(value="/{userId}", method = RequestMethod.GET)
+ @RequestMapping(value="/rest/users/{userId}", method = RequestMethod.GET)
+ @ResponseBody
public String getUser(@PathVariable("userId") String userId) {
- return null;
+ return userId;
}
}
diff --git a/REST/org.eclipse.virgo.samples.rest/src/main/webapp/META-INF/MANIFEST.MF b/REST/org.eclipse.virgo.samples.rest/src/main/webapp/META-INF/MANIFEST.MF
index 261fb20..8c7ee42 100644
--- a/REST/org.eclipse.virgo.samples.rest/src/main/webapp/META-INF/MANIFEST.MF
+++ b/REST/org.eclipse.virgo.samples.rest/src/main/webapp/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Import-Bundle: com.springsource.org.apache.taglibs.standard;version="[
1.1.2,1.3)"
Bundle-Version: 1
-Tool: Bundlor 1.1.1.RELEASE
+Tool: Bundlor 1.1.0.M04
Bundle-Name: REST Sample Web Bundle
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.virgo.samples.rest
diff --git a/REST/org.eclipse.virgo.samples.rest/src/main/webapp/WEB-INF/jsp/roy.jsp b/REST/org.eclipse.virgo.samples.rest/src/main/webapp/WEB-INF/jsp/roy.jsp
new file mode 100644
index 0000000..7e36a9a
--- /dev/null
+++ b/REST/org.eclipse.virgo.samples.rest/src/main/webapp/WEB-INF/jsp/roy.jsp
@@ -0,0 +1,74 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %><%--
+--%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--
+--%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>Configuration properties sample</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <link rel="shortcut icon" href="/resources/images/favicon.ico" />
+ <link rel="stylesheet" href="/resources/styles/main.css" type="text/css" />
+ <link rel="stylesheet" href="/resources/styles/local.css" type="text/css" />
+ <link rel="stylesheet" href="/resources/styles/print.css" type="text/css" media="print" />
+</head>
+<body class="main tundra">
+ <div id="page">
+ <div id="mini-header">
+ <div id="mini-header-left"></div>
+ <div id="mini-header-right"></div>
+ </div> <!-- /mini-header -->
+
+ <div id="primary-navigation">
+ <div id="primary-left">
+ </div>
+ <img id="left-curve" src="/config-properties/images/menu-curve-left.png"/>
+ <div id="primary-right">
+ <ul>
+ <li><a href="/admin" title="Admin Console">Admin Console</a></li>
+ <li><a href="http://www.eclipse.org/virgo" title="Virgo">Virgo</a></li>
+ </ul>
+ </div>
+ <img id="right-curve" src="/config-properties/images/menu-curve-right.png"/>
+ </div><!-- /primary-navigation -->
+
+ <div id="container">
+ <div id="content-no-nav">
+ <h1 class="title">Configuration properties sample</h1>
+ <p>
+ The following properties have been found in 'org.eclipse.virgo.samples.configuration'.
+ </p>
+ <table id="properties" class="bordered-table">
+ <tr>
+ <th>Name</th>
+ <th>Value</th>
+ </tr>
+ <c:choose>
+ <c:when test="${empty properties}">
+ <tr class="name-sublevel1-odd">
+ <td id="property_null" colspan="2">No properties have been registered.</td>
+ </tr>
+ </c:when>
+ <c:otherwise>
+ <c:forEach var="property" items="${properties}" varStatus="loopStatus">
+ <c:set var="rowStyle" value="odd" scope="page" />
+ <c:if test="${(loopStatus.index % 2) eq 0}">
+ <c:set var="rowStyle" value="even" scope="page" />
+ </c:if>
+ <tr class="sublevel1-${rowStyle}">
+ <td id="property_key">${property.key}</td>
+ <td id="property_value">${property.value}</td>
+ </tr>
+ <c:remove var="rowStyle" />
+ </c:forEach>
+ </c:otherwise>
+ </c:choose>
+ </table>
+ </div><!-- /content -->
+ </div><!-- /container -->
+
+ <div id="footer-wrapper">
+ <div id="footer-left">&copy; Copyright 2008, 2013 VMware Inc. Licensed under the Eclipse Public License v1.0.</div>
+ <div id="footer-right"></div>
+ </div>
+ </div> <!-- /page-->
+</body>
+</html> \ No newline at end of file
diff --git a/REST/org.eclipse.virgo.samples.rest/src/main/webapp/WEB-INF/sample-servlet.xml b/REST/org.eclipse.virgo.samples.rest/src/main/webapp/WEB-INF/rest-servlet.xml
index 005fc51..e4f0c3a 100644
--- a/REST/org.eclipse.virgo.samples.rest/src/main/webapp/WEB-INF/sample-servlet.xml
+++ b/REST/org.eclipse.virgo.samples.rest/src/main/webapp/WEB-INF/rest-servlet.xml
@@ -11,10 +11,16 @@
<mvc:annotation-driven />
- <context:component-scan base-package="org.eclipse.virgo.samples.configuration.properties.web" />
+ <context:component-scan base-package="org.eclipse.virgo.samples.rest" />
+ <!-- process the @RequestMapping annotations at the class level -->
+ <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" />
- <!-- VIEW CONFIG -->
+ <!-- process the @RequestMapping annotations at the method level -->
+ <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />
+
+
+ <!-- View configuration -->
<bean id="topViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
diff --git a/REST/org.eclipse.virgo.samples.rest/src/main/webapp/WEB-INF/web.xml b/REST/org.eclipse.virgo.samples.rest/src/main/webapp/WEB-INF/web.xml
index 887a7b0..769961c 100644
--- a/REST/org.eclipse.virgo.samples.rest/src/main/webapp/WEB-INF/web.xml
+++ b/REST/org.eclipse.virgo.samples.rest/src/main/webapp/WEB-INF/web.xml
@@ -8,11 +8,14 @@
<description>Virgo Server - REST Sample</description>
<welcome-file-list>
- <welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<!-- Configure a parent application context -->
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>WEB-INF/applicationContext.xml</param-value>
+ </context-param>
<context-param>
<param-name>contextClass</param-name>
@@ -25,12 +28,12 @@
<!-- Dispatcher servlet configuration -->
<servlet>
- <servlet-name>dispatcher</servlet-name>
+ <servlet-name>rest</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
- <servlet-name>dispatcher</servlet-name>
+ <servlet-name>rest</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
diff --git a/REST/org.eclipse.virgo.samples.rest/src/main/webapp/index.html b/REST/org.eclipse.virgo.samples.rest/src/main/webapp/index.html
index 053c714..fd721be 100644
--- a/REST/org.eclipse.virgo.samples.rest/src/main/webapp/index.html
+++ b/REST/org.eclipse.virgo.samples.rest/src/main/webapp/index.html
@@ -1,8 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
- <title>Virgo Sample</title>
- <meta http-equiv="REFRESH" content="0;url=/config-properties/properties/overview">
+ <title>Virgo REST Sample</title>
+ <meta http-equiv="REFRESH" content="0;url=/rest/users/user/roy">
</head>
<body>
<br/>
@@ -11,7 +11,6 @@
<p>
<em>Loading sample...</em>
</p>
- <img alt="" src="images/ajax-loader.gif">
</center>
</body>
</html> \ No newline at end of file

Back to the top