Author: mrdon Date: Wed Nov 7 01:58:42 2007 New Revision: 592678 URL: http://svn.apache.org/viewvc?rev=592678&view=rev Log: Change default xhtml extension to empty, some cleanups
Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersController.java struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/resources/struts.properties struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/index.jsp 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 Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersController.java URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersController.java?rev=592678&r1=592677&r2=592678&view=diff ============================================================================== --- struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersController.java (original) +++ struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/java/org/apache/struts2/rest/example/OrdersController.java Wed Nov 7 01:58:42 2007 @@ -9,7 +9,6 @@ import org.apache.struts2.config.Result; import org.apache.struts2.config.Results; import org.apache.struts2.dispatcher.ServletActionRedirectResult; -import org.apache.struts2.interceptor.ParameterAware; import org.apache.struts2.rest.DefaultHttpHeaders; import org.apache.struts2.rest.HttpHeaders; @@ -61,7 +60,7 @@ } public String destroy() { - orders.remove(model.getId()); + orders.remove(id); addActionMessage("Order removed successfully"); return "success"; } @@ -75,7 +74,7 @@ } public String update() { - orders.put(model.getId(), model); + orders.put(id, model); addActionMessage("Order updated successfully"); return "success"; } Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/resources/struts.properties URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/resources/struts.properties?rev=592678&r1=592677&r2=592678&view=diff ============================================================================== --- struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/resources/struts.properties (original) +++ struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/resources/struts.properties Wed Nov 7 01:58:42 2007 @@ -1,4 +1,6 @@ -struts.action.extension=xhtml,xml,json +struts.action.extension=xhtml,,xml,json struts.devMode = true + +struts.rest.defaultExtension=xhtml Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/index.jsp URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/index.jsp?rev=592678&r1=592677&r2=592678&view=diff ============================================================================== --- struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/index.jsp (original) +++ struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/index.jsp Wed Nov 7 01:58:42 2007 @@ -1,2 +1,2 @@ -<% response.sendRedirect("orders.xhtml"); %> +<% response.sendRedirect("orders"); %> Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-edit.jsp URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-edit.jsp?rev=592678&r1=592677&r2=592678&view=diff ============================================================================== --- struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-edit.jsp (original) +++ struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-edit.jsp Wed Nov 7 01:58:42 2007 @@ -9,7 +9,7 @@ <title>Order <s:property value="id" /></title> </head> <body> - <s:form method="post" action="%{#request.contextPath}/orders/%{id}.xhtml"> + <s:form method="post" action="%{#request.contextPath}/orders/%{id}"> <s:hidden name="_method" value="put" /> <table> <s:textfield name="id" label="ID" disabled="true"/> @@ -21,7 +21,7 @@ </td> </table> </s:form> - <a href="<%=request.getContextPath() %>/orders.xhtml">Back to Orders</a> + <a href="<%=request.getContextPath() %>/orders">Back to Orders</a> </body> </html> Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-editNew.jsp URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-editNew.jsp?rev=592678&r1=592677&r2=592678&view=diff ============================================================================== --- struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-editNew.jsp (original) +++ struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-editNew.jsp Wed Nov 7 01:58:42 2007 @@ -9,7 +9,7 @@ <title>New Order</title> </head> <body> - <s:form method="post" action="%{#request.contextPath}/orders.xhtml"> + <s:form method="post" action="%{#request.contextPath}/orders"> <table> <s:textfield name="clientName" label="Client"/> <s:textfield name="amount" label="Amount" /> @@ -19,7 +19,7 @@ </td> </table> </s:form> - <a href="<%=request.getContextPath() %>/orders.xhtml">Back to Orders</a> + <a href="<%=request.getContextPath() %>/orders">Back to Orders</a> </body> </html> Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-index.jsp URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-index.jsp?rev=592678&r1=592677&r2=592678&view=diff ============================================================================== --- struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-index.jsp (original) +++ struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-index.jsp Wed Nov 7 01:58:42 2007 @@ -8,27 +8,27 @@ <head> <title>Orders</title> </head> -<body> - <s:actionmessage /> - <table> - <tr> - <th>ID</th> - <th>Client</th> - <th>Amount</th> - <th>Actions</th> - </tr> - <s:iterator value="model"> - <tr> - <td><s:property value="id" /></td> - <td><s:property value="clientName" /></td> - <td><s:property value="amount" /></td> - <td><a href="orders/<s:property value="id" />.xhtml">View</a> | - <a href="orders/<s:property value="id" />;edit.xhtml">Edit</a> | - <a href="orders/<s:property value="id" />.xhtml?_method=DELETE">Delete</a></td> - </tr> - </s:iterator> - </table> - <a href="orders/new.xhtml">Create a new order</a> +<body> + <s:actionmessage /> + <table> + <tr> + <th>ID</th> + <th>Client</th> + <th>Amount</th> + <th>Actions</th> + </tr> + <s:iterator value="model"> + <tr> + <td><s:property value="id" /></td> + <td><s:property value="clientName" /></td> + <td><s:property value="amount" /></td> + <td><a href="orders/<s:property value="id" />">View</a> | + <a href="orders/<s:property value="id" />/edit">Edit</a> | + <a href="orders/<s:property value="id" />?_method=DELETE">Delete</a></td> + </tr> + </s:iterator> + </table> + <a href="orders/new">Create a new order</a> </body> </html> Modified: struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-show.jsp URL: http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-show.jsp?rev=592678&r1=592677&r2=592678&view=diff ============================================================================== --- struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-show.jsp (original) +++ struts/sandbox/trunk/struts2-rest-plugin/showcase/src/main/webapp/orders-show.jsp Wed Nov 7 01:58:42 2007 @@ -8,22 +8,22 @@ <head> <title>Order <s:property value="id" /></title> </head> -<body> - <table> - <tr> - <th>ID</th> - <td><s:property value="id" /></td> - </tr> - <tr> - <th>Client</th> - <td><s:property value="clientName" /></td> - </tr> - <tr> - <th>Amount</th> - <td><s:property value="amount" /></td> - </tr> - </table> - <a href="../orders.xhtml">Back to Orders</a> +<body> + <table> + <tr> + <th>ID</th> + <td><s:property value="id" /></td> + </tr> + <tr> + <th>Client</th> + <td><s:property value="clientName" /></td> + </tr> + <tr> + <th>Amount</th> + <td><s:property value="amount" /></td> + </tr> + </table> + <a href="../orders">Back to Orders</a> </body> </html>