[CONF] Confluence Changes in the last 24 hours
- This is a daily summary of all recent changes in Confluence. - Updated Spaces: - Apache CXF 2.0 Documentation (CXF20DOC) http://cwiki.apache.org/confluence/display/CXF20DOC | |-Pages Added or Edited in This Space |-- Navigation was last edited by [EMAIL PROTECTED] (06:09 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/Navigation |-- JAX-WS was last edited by [EMAIL PROTECTED] (05:49 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/JAX-WS |-- Simple Frontend was last edited by [EMAIL PROTECTED] (05:49 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/Simple+Frontend |-- Index was last edited by [EMAIL PROTECTED] (05:45 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/Index |-- How do I integrate my application with CXF was last edited by [EMAIL PROTECTED] (05:38 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/How+do+I+integrate+my+application+with+CXF |-- How do I develop a client? was last edited by [EMAIL PROTECTED] (05:37 PM). | http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=59871 |-- How do I develop a service? was last edited by [EMAIL PROTECTED] (05:37 PM). | http://cwiki.apache.org/confluence/pages/viewpage.action?pageId=59841 |-- Overview was created by [EMAIL PROTECTED] (05:34 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/Overview |-- Tools was last edited by [EMAIL PROTECTED] (05:29 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/Tools |-- DataBindings was last edited by [EMAIL PROTECTED] (05:25 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/DataBindings |-- Transports was last edited by [EMAIL PROTECTED] (05:23 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/Transports |-- HTTP Transport was last edited by [EMAIL PROTECTED] (05:23 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/HTTP+Transport |-- JMS Transport was last edited by [EMAIL PROTECTED] (05:20 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/JMS+Transport |-- JAX-WS Configuration was last edited by [EMAIL PROTECTED] (05:19 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/JAX-WS+Configuration |-- Building your cxf project with maven was created by [EMAIL PROTECTED] (05:12 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/Building+your+cxf+project+with+maven |-- How-Tos was last edited by [EMAIL PROTECTED] (05:09 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/How-Tos |-- A simple JAX-WS service was last edited by [EMAIL PROTECTED] (04:59 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/A+simple+JAX-WS+service |-- Developing a Service was last edited by [EMAIL PROTECTED] (01:35 PM). | http://cwiki.apache.org/confluence/display/CXF20DOC/Developing+a+Service Apache Geronimo v2.0 (GMOxDOC20) http://cwiki.apache.org/confluence/display/GMOxDOC20 | |-Pages Added or Edited in This Space |-- LDAP Realm was last edited by heinz drews (07:22 AM). | http://cwiki.apache.org/confluence/display/GMOxDOC20/LDAP+Realm Apache ServiceMix (SM) http://cwiki.apache.org/confluence/display/SM | |-Pages Added or Edited in This Space |-- How do I change the logging was last edited by [EMAIL PROTECTED] (09:20 PM). | http://cwiki.apache.org/confluence/display/SM/How+do+I+change+the+logging |-- How to compile without Checkstyle was created by [EMAIL PROTECTED] (09:15 PM). | http://cwiki.apache.org/confluence/display/SM/How+to+compile+without+Checkstyle |-- Strange Maven Build Problem was created by [EMAIL PROTECTED] (09:07 PM). | http://cwiki.apache.org/confluence/display/SM/Strange+Maven+Build+Problem |-- servicemix-script was last edited by [EMAIL PROTECTED] (08:52 PM). | http://cwiki.apache.org/confluence/display/SM/servicemix-script - CONFLUENCE INFORMATION This message is automatically generated by Confluence Unsubscribe or edit your notifications preferences http://cwiki.apache.org/confluence/users/viewnotifications.action If you think it was sent incorrectly contact one of the administrators http://cwiki.apache.org/confluence/administrators.action If you want more information on Confluence, or have a bug to report see http://www.atlassian.com/software/confluence
svn commit: r586868 - in /struts/sandbox/trunk/struts2-rest-plugin: showcase/src/main/java/org/apache/struts2/rest/example/ src/main/java/org/apache/struts2/rest/ src/main/resources/
Author: mrdon Date: Sun Oct 21 01:17:30 2007 New Revision: 586868 URL: http://svn.apache.org/viewvc?rev=586868&view=rev Log: Adding automatic validation support Added: struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java - copied, changed from r586735, struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerSelector.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestWorkflowInterceptor.java Removed: struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerSelector.java Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrderResource.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/DefaultRestInfo.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ResourceClasspathPackageProvider.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestActionInvocation.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestInfo.java struts/sandbox/trunk/struts2-rest-plugin/src/main/resources/struts-plugin.xml Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrderResource.java URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrderResource.java?rev=586868&r1=586867&r2=586868&view=diff == --- struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrderResource.java (original) +++ struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrderResource.java Sun Oct 21 01:17:30 2007 @@ -11,8 +11,10 @@ import org.apache.struts2.rest.RestInfo; import com.opensymphony.xwork2.ModelDriven; +import com.opensymphony.xwork2.Validateable; +import com.opensymphony.xwork2.ValidationAwareSupport; -public class OrderResource implements ModelDriven, ParameterAware{ +public class OrderResource extends ValidationAwareSupport implements ModelDriven, ParameterAware, Validateable{ private Order model = new Order(); private static Map orders = new HashMap() {{ @@ -21,6 +23,12 @@ put("5", new Order("5", "Jim", 66)); }}; private Collection list; + +public void validate() { +if (model.getId() == null || model.getId().length() ==0) { +addFieldError("id", "ID is wrong"); +} +} public String show() { return "show"; Copied: struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java (from r586735, struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerSelector.java) URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java?p2=struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java&p1=struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerSelector.java&r1=586735&r2=586868&rev=586868&view=diff == --- struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerSelector.java (original) +++ struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java Sun Oct 21 01:17:30 2007 @@ -1,17 +1,43 @@ +/* + * $Id: Restful2ActionMapper.java 540819 2007-05-23 02:48:36Z mrdon $ + * + * 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. + */ package org.apache.struts2.rest; +import java.io.ByteArrayOutputStream; +import java.io.IOException; import java.util.HashMap; import j
svn commit: r586882 - in /struts/sandbox/trunk/struts2-rest-plugin: showcase/src/main/java/org/apache/struts2/rest/example/ showcase/src/main/webapp/ src/main/java/org/apache/struts2/rest/ src/main/ja
Author: mrdon Date: Sun Oct 21 03:43:07 2007 New Revision: 586882 URL: http://svn.apache.org/viewvc?rev=586882&view=rev Log: Changing url conventions to match rails Added: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-edit.jsp struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-editNew.jsp struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-index.jsp struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-show.jsp struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-success.jsp Removed: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrderResource.java struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/order-index.jsp struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/order-input.jsp struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/order-new.jsp struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/order-show.jsp struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/order-success.jsp Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/Order.java struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/index.jsp struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestActionMapper.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestWorkflowInterceptor.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java struts/sandbox/trunk/struts2-rest-plugin/src/main/resources/struts-plugin.xml struts/sandbox/trunk/struts2-rest-plugin/src/test/java/org/apache/struts2/rest/RestActionMapperTest.java Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/Order.java URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/Order.java?rev=586882&r1=586881&r2=586882&view=diff == --- struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/Order.java (original) +++ struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/Order.java Sun Oct 21 03:43:07 2007 @@ -1,5 +1,7 @@ package org.apache.struts2.rest.example; +import com.thoughtworks.xstream.annotations.XStreamAlias; + public class Order { String id; String clientName; Added: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java?rev=586882&view=auto == --- struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java (added) +++ struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java Sun Oct 21 03:43:07 2007 @@ -0,0 +1,84 @@ +package org.apache.struts2.rest.example; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.struts2.interceptor.ParameterAware; +import org.apache.struts2.rest.DefaultRestInfo; +import org.apache.struts2.rest.RestInfo; + +import com.opensymphony.xwork2.ModelDriven; +import com.opensymphony.xwork2.Validateable; +import com.opensymphony.xwork2.ValidationAwareSupport; + +public class OrdersResource extends ValidationAwareSupport implements ModelDriven, ParameterAware, Validateable{ + +private Order model = new Order(); +private static Map orders = new HashMap(); + +static { +orders.put("3", new Order("3", "Bob", 33)); +orders.put("4", new Order("4", "Sarah", 44)); +orders.put("5", new Order("5", "Jim", 66)); +} +private Collection list; + +public void validate() { +if (model.getId() == null || model.getId().length() ==0) { +addFieldError("id", "ID is wrong"); +} +} + +public String show() { +return "show"; +} + +public String edit() { +return "edit"; +} + +public String editNew() { +return "editNew"; +} + +public String destroy() { +orders.remove(model.getId()); +return "success"; +} + +public RestInfo create() { +orders.put(model.getId(), model); +re
svn commit: r586885 - in /struts/sandbox/trunk/struts2-rest-plugin: showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java src/main/java/org/apache/struts2/rest/handler/XStreamHand
Author: mrdon Date: Sun Oct 21 04:24:30 2007 New Revision: 586885 URL: http://svn.apache.org/viewvc?rev=586885&view=rev Log: Tweaks to ensure nothign is returned when it doesn't need to be Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java?rev=586885&r1=586884&r2=586885&view=diff == --- struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java (original) +++ struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java Sun Oct 21 04:24:30 2007 @@ -46,11 +46,13 @@ public String destroy() { orders.remove(model.getId()); +model = null; return "success"; } public RestInfo create() { orders.put(model.getId(), model); +model = null; return new DefaultRestInfo() .setLocationId(model.getId()) .renderResult("success"); @@ -58,6 +60,7 @@ public String update() { orders.put(model.getId(), model); +model = null; return "success"; } Modified: struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java?rev=586885&r1=586884&r2=586885&view=diff == --- struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java (original) +++ struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java Sun Oct 21 04:24:30 2007 @@ -29,8 +29,10 @@ public class XStreamHandler implements ContentTypeHandler { public String fromObject(Object obj, String resultCode, OutputStream out) throws IOException { -XStream xstream = createXStream(); -xstream.toXML(obj, out); +if (obj != null) { +XStream xstream = createXStream(); +xstream.toXML(obj, out); +} return null; }
svn commit: r586887 - in /struts/sandbox/trunk/struts2-rest-plugin: showcase/src/main/java/org/apache/struts2/rest/example/ src/main/java/org/apache/struts2/rest/
Author: mrdon Date: Sun Oct 21 04:58:21 2007 New Revision: 586887 URL: http://svn.apache.org/viewvc?rev=586887&view=rev Log: Automatic handling to ensure no return from OK PUT, POST, and DELETE Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/DefaultRestInfo.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestInfo.java Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java?rev=586887&r1=586886&r2=586887&view=diff == --- struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java (original) +++ struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersResource.java Sun Oct 21 04:58:21 2007 @@ -46,13 +46,11 @@ public String destroy() { orders.remove(model.getId()); -model = null; return "success"; } public RestInfo create() { orders.put(model.getId(), model); -model = null; return new DefaultRestInfo() .setLocationId(model.getId()) .renderResult("success"); @@ -60,7 +58,6 @@ public String update() { orders.put(model.getId(), model); -model = null; return "success"; } Modified: struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java?rev=586887&r1=586886&r2=586887&view=diff == --- struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java (original) +++ struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java Sun Oct 21 04:58:21 2007 @@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import static javax.servlet.http.HttpServletResponse.SC_OK; import org.apache.struts2.ServletActionContext; import org.apache.struts2.rest.handler.ContentTypeHandler; @@ -73,12 +74,22 @@ target = ((ModelDriven)target).getModel(); } +boolean statusNotOk = false; if (methodResult instanceof RestInfo) { RestInfo info = (RestInfo) methodResult; resultCode = info.apply(req, res, target); +if (info.getStatus() != SC_OK) { +statusNotOk = true; +} } else { resultCode = (String) methodResult; } + +// Don't return any content for PUT, DELETE, and POST where there are no errors +if (!statusNotOk && !"get".equalsIgnoreCase(req.getMethod())) { +target = null; +} + ContentTypeHandler handler = getHandlerForRequest(req); String extCode = resultCode+"-"+handler.getExtension(); if (actionConfig.getResults().get(extCode) != null) { @@ -95,6 +106,7 @@ } } return resultCode; + } protected String findExtension(String url) { Modified: struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/DefaultRestInfo.java URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/DefaultRestInfo.java?rev=586887&r1=586886&r2=586887&view=diff == --- struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/DefaultRestInfo.java (original) +++ struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/DefaultRestInfo.java Sun Oct 21 04:58:21 2007 @@ -101,6 +101,10 @@ } return resultCode; } + +public int getStatus() { +return status; +} Modified: struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestInfo.java URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestInfo.java?rev=586887&r1=586886&r2=586887&view=diff == --- struts/sandbox/trunk/struts2-rest-plugin/src
svn commit: r586892 - in /struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest: ./ handler/
Author: mrdon Date: Sun Oct 21 06:01:37 2007 New Revision: 586892 URL: http://svn.apache.org/viewvc?rev=586892&view=rev Log: Adding javadocs Modified: struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/DefaultRestInfo.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestActionInvocation.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestActionMapper.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestActionProxyFactory.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestInfo.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestWorkflowInterceptor.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/handler/ContentTypeHandler.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/handler/HtmlHandler.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/handler/XStreamHandler.java struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/handler/XStreamJsonHandler.java Modified: struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java?rev=586892&r1=586891&r2=586892&view=diff == --- struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java (original) +++ struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeHandlerManager.java Sun Oct 21 06:01:37 2007 @@ -38,6 +38,10 @@ import com.opensymphony.xwork2.inject.Container; import com.opensymphony.xwork2.inject.Inject; +/** + * Manages [EMAIL PROTECTED] ContentTypeHandler} instances and uses them to + * process results + */ public class ContentTypeHandlerManager { private Map handlers = new HashMap(); @@ -57,6 +61,11 @@ } } +/** + * Gets the handler for the request by looking at the extension + * @param req The request + * @return The appropriate handler + */ public ContentTypeHandler getHandlerForRequest(HttpServletRequest req) { String extension = findExtension(req.getRequestURI()); if (extension == null) { @@ -65,6 +74,15 @@ return handlers.get(extension); } +/** + * Handles the result using handlers to generate content type-specific content + * + * @param actionConfig The action config for the current request + * @param methodResult The object returned from the action method + * @param target The object to return, usually the action object + * @return The new result code to process + * @throws IOException If unable to write to the response + */ public String handleResult(ActionConfig actionConfig, Object methodResult, Object target) throws IOException { String resultCode = null; @@ -109,6 +127,12 @@ } +/** + * Finds the extension in the url + * + * @param url The url + * @return The extension + */ protected String findExtension(String url) { int dotPos = url.lastIndexOf('.'); int slashPos = url.lastIndexOf('/'); Modified: struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java?rev=586892&r1=586891&r2=586892&view=diff == --- struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java (original) +++ struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/ContentTypeInterceptor.java Sun Oct 21 06:01:37 2007 @@ -30,8 +30,12 @@ import com.opensymphony.xwork2.inject.Inject; import com.opensymphony.xwork2.interceptor.Interceptor; +/** + * Uses the content handler to apply the request body to the action + */ public class ContentTypeInterceptor implements Interceptor { +private static final long serialVersionUID = 1L; ContentTypeHandlerManager selector; @Inject Modified: struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/DefaultRestInfo.java URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts
svn commit: r586901 - in /struts/sandbox/trunk/struts2-rest-plugin: showcase/src/main/webapp/WEB-INF/web.xml src/main/java/org/apache/struts2/rest/RestActionMapper.java
Author: mrdon Date: Sun Oct 21 07:07:34 2007 New Revision: 586901 URL: http://svn.apache.org/viewvc?rev=586901&view=rev Log: Tweaking javadocs Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/WEB-INF/web.xml struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestActionMapper.java Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/WEB-INF/web.xml?rev=586901&r1=586900&r2=586901&view=diff == --- struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/WEB-INF/web.xml (original) +++ struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/WEB-INF/web.xml Sun Oct 21 07:07:34 2007 @@ -9,6 +9,7 @@ + action2 org.apache.struts2.dispatcher.FilterDispatcher @@ -17,6 +18,7 @@ org.apache.struts2.rest.example + action2 Modified: struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestActionMapper.java URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestActionMapper.java?rev=586901&r1=586900&r2=586901&view=diff == --- struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestActionMapper.java (original) +++ struts/sandbox/trunk/struts2-rest-plugin/src/main/java/org/apache/struts2/rest/RestActionMapper.java Sun Oct 21 07:07:34 2007 @@ -39,7 +39,7 @@ /** * * - * Restful action mapper that enforces Ruby-On-Rails Rest-style mappings.If the method + * This Restful action mapper enforces Ruby-On-Rails Rest-style mappings. If the method * is not specified (via '!' or 'method:' prefix), the method is "guessed" at using * ReST-style conventions that examine the URL and the HTTP method. Special care has * been given to ensure this mapper works correctly with the codebehind plugin so that
svn commit: r586974 - /struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/RequestAware.java
Author: davenewton Date: Sun Oct 21 16:33:53 2007 New Revision: 586974 URL: http://svn.apache.org/viewvc?rev=586974&view=rev Log: RequestAware JavaDoc clarification. Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/RequestAware.java Modified: struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/RequestAware.java URL: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/RequestAware.java?rev=586974&r1=586973&r2=586974&view=diff == --- struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/RequestAware.java (original) +++ struts/struts2/trunk/core/src/main/java/org/apache/struts2/interceptor/RequestAware.java Sun Oct 21 16:33:53 2007 @@ -27,9 +27,6 @@ * Actions that want access to the current serlvet request attributes should implement this interface. * * This interface is only relevant if the Action is used in a servlet environment. - * - * Note that using this interface makes the Action tied to a servlet environment, so it should be - * avoided if possible since things like unit testing will become more difficult. */ public interface RequestAware {
svn commit: r586985 - /struts/site/src/site/xdoc/dev/volunteers.xml
Author: martinc Date: Sun Oct 21 19:41:41 2007 New Revision: 586985 URL: http://svn.apache.org/viewvc?rev=586985&view=rev Log: Committers += Dave Newton, Brian Pontarelli Modified: struts/site/src/site/xdoc/dev/volunteers.xml Modified: struts/site/src/site/xdoc/dev/volunteers.xml URL: http://svn.apache.org/viewvc/struts/site/src/site/xdoc/dev/volunteers.xml?rev=586985&r1=586984&r2=586985&view=diff == --- struts/site/src/site/xdoc/dev/volunteers.xml (original) +++ struts/site/src/site/xdoc/dev/volunteers.xml Sun Oct 21 19:41:41 2007 @@ -217,6 +217,14 @@ Matt Raible (mraible at apache.org) + + Dave Newton + (davenewton at apache.org) + + + Brian Pontarelli + (bpontarelli at apache.org) +
svn commit: r586986 - /struts/site/src/site/xdoc/dev/volunteers.xml
Author: martinc Date: Sun Oct 21 19:43:01 2007 New Revision: 586986 URL: http://svn.apache.org/viewvc?rev=586986&view=rev Log: Fix indentation. Modified: struts/site/src/site/xdoc/dev/volunteers.xml Modified: struts/site/src/site/xdoc/dev/volunteers.xml URL: http://svn.apache.org/viewvc/struts/site/src/site/xdoc/dev/volunteers.xml?rev=586986&r1=586985&r2=586986&view=diff == --- struts/site/src/site/xdoc/dev/volunteers.xml (original) +++ struts/site/src/site/xdoc/dev/volunteers.xml Sun Oct 21 19:43:01 2007 @@ -204,27 +204,27 @@ David H. DeWolf (ddewolf at apache.org) - + Philip Luppens (phil at apache.org) - + Tom Schneider (tschneider at apache.org) - + Matt Raible (mraible at apache.org) - + Dave Newton (davenewton at apache.org) - + Brian Pontarelli (bpontarelli at apache.org) - +