<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Struts2 Rest Webservice</title>
	<atom:link href="http://blog.mersoft.com/2009/09/08/struts2-rest-webservice/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mersoft.com/2009/09/08/struts2-rest-webservice/</link>
	<description>Achieve, Compete, and Evolve</description>
	<lastBuildDate>Tue, 31 Jan 2012 14:42:59 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Siregar</title>
		<link>http://blog.mersoft.com/2009/09/08/struts2-rest-webservice/comment-page-1/#comment-25</link>
		<dc:creator>Siregar</dc:creator>
		<pubDate>Sun, 27 Nov 2011 03:48:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mersoft.com/?p=242#comment-25</guid>
		<description>could you give me the zip of this project?</description>
		<content:encoded><![CDATA[<p>could you give me the zip of this project?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Andersen</title>
		<link>http://blog.mersoft.com/2009/09/08/struts2-rest-webservice/comment-page-1/#comment-22</link>
		<dc:creator>Daniel Andersen</dc:creator>
		<pubDate>Tue, 26 Jul 2011 21:05:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mersoft.com/?p=242#comment-22</guid>
		<description>I have been building a REST service using this guide and needed to access properties from a global properties file.  I was initially unable to use the getText() method of a typical ActionSupport because ValidationAwareSupport does not implement TextProvider.  I found that the REST plugin has the RestActionSupport class (a subclass of ActionSupport), and when changing the class of the controllers to this (changing the return type of methods from HttpHeaders to String), everything works as expected.</description>
		<content:encoded><![CDATA[<p>I have been building a REST service using this guide and needed to access properties from a global properties file.  I was initially unable to use the getText() method of a typical ActionSupport because ValidationAwareSupport does not implement TextProvider.  I found that the REST plugin has the RestActionSupport class (a subclass of ActionSupport), and when changing the class of the controllers to this (changing the return type of methods from HttpHeaders to String), everything works as expected.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mandi Zinn</title>
		<link>http://blog.mersoft.com/2009/09/08/struts2-rest-webservice/comment-page-1/#comment-20</link>
		<dc:creator>Mandi Zinn</dc:creator>
		<pubDate>Wed, 29 Jun 2011 17:29:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mersoft.com/?p=242#comment-20</guid>
		<description>Thanks for the additional tip. I&#039;ll add it to the blog.

Mandi</description>
		<content:encoded><![CDATA[<p>Thanks for the additional tip. I&#8217;ll add it to the blog.</p>
<p>Mandi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mandi Zinn</title>
		<link>http://blog.mersoft.com/2009/09/08/struts2-rest-webservice/comment-page-1/#comment-19</link>
		<dc:creator>Mandi Zinn</dc:creator>
		<pubDate>Wed, 29 Jun 2011 17:28:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mersoft.com/?p=242#comment-19</guid>
		<description>Nacer,

You can use json out of the box by using the extension .json (instead of .xml). If you need to customize your json response, you can add a custom json result handler by editing the following files:

1. struts.xml: Add the following line: 
  &lt;bean type=&quot;org.apache.struts2.rest.handler.ContentTypeHandler&quot; name=&quot;myJson&quot; class=&quot;com.mersoft.rest.handler.JsonHandler&quot; /&gt;

2. struts.properties:
struts.rest.handlerOverride.json=myJson

3. Define the JsonHandler. It must implement org.apache.struts2.rest.handler.ContentTypeHandler. Make sure the getExtension() method returns &quot;json&quot;.

After this, you should be able to make your requests with a .json extension and use your new handler.

Mandi</description>
		<content:encoded><![CDATA[<p>Nacer,</p>
<p>You can use json out of the box by using the extension .json (instead of .xml). If you need to customize your json response, you can add a custom json result handler by editing the following files:</p>
<p>1. struts.xml: Add the following line:<br />
  &lt;bean type=&#8221;org.apache.struts2.rest.handler.ContentTypeHandler&#8221; name=&#8221;myJson&#8221; class=&#8221;com.mersoft.rest.handler.JsonHandler&#8221; /&gt;</p>
<p>2. struts.properties:<br />
struts.rest.handlerOverride.json=myJson</p>
<p>3. Define the JsonHandler. It must implement org.apache.struts2.rest.handler.ContentTypeHandler. Make sure the getExtension() method returns &#8220;json&#8221;.</p>
<p>After this, you should be able to make your requests with a .json extension and use your new handler.</p>
<p>Mandi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Andersen</title>
		<link>http://blog.mersoft.com/2009/09/08/struts2-rest-webservice/comment-page-1/#comment-18</link>
		<dc:creator>Daniel Andersen</dc:creator>
		<pubDate>Wed, 29 Jun 2011 14:18:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mersoft.com/?p=242#comment-18</guid>
		<description>This is a very helpful guide.  I would like to add a piece of information in hopes that others working on REST webservices do not have the trouble I did. 

Take care when dealing with objects labeled with &quot;multiple&quot; names.  For example, I had been working on creating a service for a &quot;ShortLink&quot; object.  The associated controller (ShortLinkController) could not be found by the server.  Renaming my object to &quot;Shortlink&quot; and the controller to &quot;ShortlinkController&quot; solved this problem.</description>
		<content:encoded><![CDATA[<p>This is a very helpful guide.  I would like to add a piece of information in hopes that others working on REST webservices do not have the trouble I did. </p>
<p>Take care when dealing with objects labeled with &#8220;multiple&#8221; names.  For example, I had been working on creating a service for a &#8220;ShortLink&#8221; object.  The associated controller (ShortLinkController) could not be found by the server.  Renaming my object to &#8220;Shortlink&#8221; and the controller to &#8220;ShortlinkController&#8221; solved this problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nacer</title>
		<link>http://blog.mersoft.com/2009/09/08/struts2-rest-webservice/comment-page-1/#comment-17</link>
		<dc:creator>nacer</dc:creator>
		<pubDate>Tue, 31 May 2011 14:48:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mersoft.com/?p=242#comment-17</guid>
		<description>hi 
thx for the help for Customizing xml response.
but i&#039;m stuck in adding json result handling.
i have just began developping struts 2.
can you help me with that?</description>
		<content:encoded><![CDATA[<p>hi<br />
thx for the help for Customizing xml response.<br />
but i&#8217;m stuck in adding json result handling.<br />
i have just began developping struts 2.<br />
can you help me with that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mandi Zinn</title>
		<link>http://blog.mersoft.com/2009/09/08/struts2-rest-webservice/comment-page-1/#comment-16</link>
		<dc:creator>Mandi Zinn</dc:creator>
		<pubDate>Mon, 14 Feb 2011 22:53:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mersoft.com/?p=242#comment-16</guid>
		<description>Damodar,

In your struts.xml, did you set the struts.convention.package.locators? This should be the end of the package name. For example if your controllers are in package com.mersoft.web.controller, then the struts.convention.package.locators should be &quot;controller&quot;.

Does this help?

Mandi</description>
		<content:encoded><![CDATA[<p>Damodar,</p>
<p>In your struts.xml, did you set the struts.convention.package.locators? This should be the end of the package name. For example if your controllers are in package com.mersoft.web.controller, then the struts.convention.package.locators should be &#8220;controller&#8221;.</p>
<p>Does this help?</p>
<p>Mandi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dammy</title>
		<link>http://blog.mersoft.com/2009/09/08/struts2-rest-webservice/comment-page-1/#comment-15</link>
		<dc:creator>Dammy</dc:creator>
		<pubDate>Mon, 14 Feb 2011 13:34:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mersoft.com/?p=242#comment-15</guid>
		<description>Hi Mandi,

This is a very nice material. I got the idea of how we can use REST services with Struts. Thanks for posting.

Here, I am facing one issue while following the steps you have mentioned. I have added the Maven dependencies, and changed the struts.xml and web.xml as you mentioned. Created the model and contoller classes under my working directory. But when I try to hit the URL, I am getting &quot;HTTP Status 404 - There is no Action mapped for action name test.&quot;

Please let me know if I need to check anything else.

Thanks,
Damodar</description>
		<content:encoded><![CDATA[<p>Hi Mandi,</p>
<p>This is a very nice material. I got the idea of how we can use REST services with Struts. Thanks for posting.</p>
<p>Here, I am facing one issue while following the steps you have mentioned. I have added the Maven dependencies, and changed the struts.xml and web.xml as you mentioned. Created the model and contoller classes under my working directory. But when I try to hit the URL, I am getting &#8220;HTTP Status 404 &#8211; There is no Action mapped for action name test.&#8221;</p>
<p>Please let me know if I need to check anything else.</p>
<p>Thanks,<br />
Damodar</p>
]]></content:encoded>
	</item>
</channel>
</rss>

