<?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: Using a Hybrid Annotations &amp; XML Approach for Request Mapping in Spring MVC</title>
	<atom:link href="http://blog.springsource.org/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.springsource.org/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/</link>
	<description>The voice of SpringSource</description>
	<lastBuildDate>Wed, 08 Feb 2012 17:31:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
	<item>
		<title>By: rahul</title>
		<link>http://blog.springsource.org/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/comment-page-1/#comment-171110</link>
		<dc:creator>rahul</dc:creator>
		<pubDate>Mon, 25 Jan 2010 14:45:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/#comment-171110</guid>
		<description>Hi,
I have one problem facing using the Spring MVC using annotation.
Can you please look into it.. As i am new to it. Because Form controller become deprecated. So , i am going for Annotation. 

Please see the post which i have done in the spring web forum.
As per me , it may be bug inside the spring 3.0.....

http://forum.springsource.org/showthread.php?t=83605

if you are not able to reach this post , then search for &quot;RequestMaping calling two times for one submit&quot;

Please reply back

Thanks
Rahul</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I have one problem facing using the Spring MVC using annotation.<br />
Can you please look into it.. As i am new to it. Because Form controller become deprecated. So , i am going for Annotation. </p>
<p>Please see the post which i have done in the spring web forum.<br />
As per me , it may be bug inside the spring 3.0&#8230;..</p>
<p><a href="http://forum.springsource.org/showthread.php?t=83605" rel="nofollow">http://forum.springsource.org/showthread.php?t=83605</a></p>
<p>if you are not able to reach this post , then search for &#034;RequestMaping calling two times for one submit&#034;</p>
<p>Please reply back</p>
<p>Thanks<br />
Rahul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rossen Stoyanchev</title>
		<link>http://blog.springsource.org/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/comment-page-1/#comment-170825</link>
		<dc:creator>Rossen Stoyanchev</dc:creator>
		<pubDate>Mon, 04 Jan 2010 09:09:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/#comment-170825</guid>
		<description>John, you will find sample code associated with this blog entry (http://blog.springsource.com/2009/12/21/mvc-simplifications-in-spring-3-0/) based on Spring 3.0 that is now final. More quality samples available at http://springbyexample.org. Last but not least I recommend you give Roo a try http://blog.springsource.com/2009/12/31/spring-roo-1-0-0-released/. It will generate you a Spring MVC application in just a few commands.</description>
		<content:encoded><![CDATA[<p>John, you will find sample code associated with this blog entry (<a href="http://blog.springsource.com/2009/12/21/mvc-simplifications-in-spring-3-0/" rel="nofollow">http://blog.springsource.com/2009/12/21/mvc-simplifications-in-spring-3-0/</a>) based on Spring 3.0 that is now final. More quality samples available at <a href="http://springbyexample.org" rel="nofollow">http://springbyexample.org</a>. Last but not least I recommend you give Roo a try <a href="http://blog.springsource.com/2009/12/31/spring-roo-1-0-0-released/" rel="nofollow">http://blog.springsource.com/2009/12/31/spring-roo-1-0-0-released/</a>. It will generate you a Spring MVC application in just a few commands.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Smith</title>
		<link>http://blog.springsource.org/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/comment-page-1/#comment-170819</link>
		<dc:creator>John Smith</dc:creator>
		<pubDate>Sun, 03 Jan 2010 19:36:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/#comment-170819</guid>
		<description>Hi:


I downloaded &quot;spring-framework-2.5.6.SEC01&quot; but I can&#039;t seemed to find an example of a Spring Mvc Annotations example in the &quot;C:\Download\Spring25\temp\spring-framework-2.5.6.SEC01\samples&quot; directory. Does anybody know of a good Spring MVC Annotations example I can download from the web or from the spring web site.

Any help or hint would be greatly appreciated it.

Yours,

Frustrated.</description>
		<content:encoded><![CDATA[<p>Hi:</p>
<p>I downloaded &#034;spring-framework-2.5.6.SEC01&#034; but I can&#039;t seemed to find an example of a Spring Mvc Annotations example in the &#034;C:\Download\Spring25\temp\spring-framework-2.5.6.SEC01\samples&#034; directory. Does anybody know of a good Spring MVC Annotations example I can download from the web or from the spring web site.</p>
<p>Any help or hint would be greatly appreciated it.</p>
<p>Yours,</p>
<p>Frustrated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Smith</title>
		<link>http://blog.springsource.org/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/comment-page-1/#comment-170818</link>
		<dc:creator>John Smith</dc:creator>
		<pubDate>Sun, 03 Jan 2010 19:29:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/#comment-170818</guid>
		<description>Hi:

Does anybody know where to get the full code  download for this excellent example?</description>
		<content:encoded><![CDATA[<p>Hi:</p>
<p>Does anybody know where to get the full code  download for this excellent example?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rossen Stoyanchev</title>
		<link>http://blog.springsource.org/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/comment-page-1/#comment-158313</link>
		<dc:creator>Rossen Stoyanchev</dc:creator>
		<pubDate>Wed, 01 Apr 2009 01:24:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/#comment-158313</guid>
		<description>Hi Miguel, have you thought about using a HandlerInterceptor? The security example you provided does not seem to be in any way tied to the controller.</description>
		<content:encoded><![CDATA[<p>Hi Miguel, have you thought about using a HandlerInterceptor? The security example you provided does not seem to be in any way tied to the controller.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: miguel</title>
		<link>http://blog.springsource.org/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/comment-page-1/#comment-158204</link>
		<dc:creator>miguel</dc:creator>
		<pubDate>Tue, 31 Mar 2009 23:03:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/#comment-158204</guid>
		<description>My comment has not received any responses, maybe because this blog post is old, maybe because I didn&#039;t explain myself well or maybe because I provided a bad example since Acegi is available for security.  Still, I think there is a fatal flaw in @MVC which I haven&#039;t seen addressed anywhere and it worries me because apparently the interface-based MVC is going to be deprecated.

Maybe a better example about my concern is a web site with a common HTML component across all pages, perhaps a menu or a dynamic header.  Using @MVC, every single @RequestMapping method will have to populate the model with the data for the common components.  You could extract this into some external method, but there is no way around the fact that every single @RequestMapping method will have to make this call.

Does no one else see the inability to do OO inheritance as a problem? To me, the loss of inheritance is a hell of a price to pay just to simplify XML configuration.  Inheritance is one of the main features of an OO language, without OO is this even Java anymore?</description>
		<content:encoded><![CDATA[<p>My comment has not received any responses, maybe because this blog post is old, maybe because I didn&#039;t explain myself well or maybe because I provided a bad example since Acegi is available for security.  Still, I think there is a fatal flaw in @MVC which I haven&#039;t seen addressed anywhere and it worries me because apparently the interface-based MVC is going to be deprecated.</p>
<p>Maybe a better example about my concern is a web site with a common HTML component across all pages, perhaps a menu or a dynamic header.  Using @MVC, every single @RequestMapping method will have to populate the model with the data for the common components.  You could extract this into some external method, but there is no way around the fact that every single @RequestMapping method will have to make this call.</p>
<p>Does no one else see the inability to do OO inheritance as a problem? To me, the loss of inheritance is a hell of a price to pay just to simplify XML configuration.  Inheritance is one of the main features of an OO language, without OO is this even Java anymore?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: miguel</title>
		<link>http://blog.springsource.org/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/comment-page-1/#comment-155645</link>
		<dc:creator>miguel</dc:creator>
		<pubDate>Thu, 26 Mar 2009 20:14:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/#comment-155645</guid>
		<description>This approach alleviates one of my concerns with the @Controller technique.  But my other main concern is how I have lost the ability to have base controllers process common portions of request, for example for security.  To me, having a base controller is much more readable and understandable than having filters or interceptors doing magical invisible things that some developers might not notice, it&#039;s also more OO-ish.

I suppose one approach would be to create methods in a base controller tagged with @RequestMapping for GET and POST like this:

public abstract class BaseSecurityController {
	@RequestMapping(method=RequestMethod.GET)
	public String checkSecurity(HttpServletRequest req) {
		if (!securityService.checkAuth(req)) {
			return &quot;loginView&quot;;
		}
		handleGet(req);
	}
	public abstract void handleGet(HttpServletRequest req);
}

@Controller
public class SomePageController extends BaseSecureController {
	@Override
	public String handleGet(HttpServletRequest req) {
		//....
		return &quot;view&quot;;
	}
}

But that removes a lot of the flexibility of the method signatures and @RequestMapping. Is there a better technique?</description>
		<content:encoded><![CDATA[<p>This approach alleviates one of my concerns with the @Controller technique.  But my other main concern is how I have lost the ability to have base controllers process common portions of request, for example for security.  To me, having a base controller is much more readable and understandable than having filters or interceptors doing magical invisible things that some developers might not notice, it&#039;s also more OO-ish.</p>
<p>I suppose one approach would be to create methods in a base controller tagged with @RequestMapping for GET and POST like this:</p>
<p>public abstract class BaseSecurityController {<br />
	@RequestMapping(method=RequestMethod.GET)<br />
	public String checkSecurity(HttpServletRequest req) {<br />
		if (!securityService.checkAuth(req)) {<br />
			return &#034;loginView&#034;;<br />
		}<br />
		handleGet(req);<br />
	}<br />
	public abstract void handleGet(HttpServletRequest req);<br />
}</p>
<p>@Controller<br />
public class SomePageController extends BaseSecureController {<br />
	@Override<br />
	public String handleGet(HttpServletRequest req) {<br />
		//&#8230;.<br />
		return &#034;view&#034;;<br />
	}<br />
}</p>
<p>But that removes a lot of the flexibility of the method signatures and @RequestMapping. Is there a better technique?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Using a Hybrid Annotations &#38; XML Approach for Request Mapping in Spring MVC &#171; Jared Blitzstein</title>
		<link>http://blog.springsource.org/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/comment-page-1/#comment-154561</link>
		<dc:creator>Using a Hybrid Annotations &#38; XML Approach for Request Mapping in Spring MVC &#171; Jared Blitzstein</dc:creator>
		<pubDate>Tue, 24 Mar 2009 15:29:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/#comment-154561</guid>
		<description>[...] SpringSource Team Blog » Using a Hybrid Annotations &amp; XML Approach for Request Mapping in Sprin.... [...]</description>
		<content:encoded><![CDATA[<p>[...] SpringSource Team Blog » Using a Hybrid Annotations &amp; XML Approach for Request Mapping in Sprin&#8230;. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rossen Stoyanchev</title>
		<link>http://blog.springsource.org/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/comment-page-1/#comment-121933</link>
		<dc:creator>Rossen Stoyanchev</dc:creator>
		<pubDate>Fri, 19 Sep 2008 17:31:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/#comment-121933</guid>
		<description>Javier,

There is an SPR mentioned in the posting that was resolved in Spring 2.5.3. Have a look at using ControllerClassNameHandlerMapping instead of SimpleUrlHandlerMapping. The approach works with both @Controller and with XML-based controllers. 

For more details see this infoq article:
http://www.infoq.com/articles/spring-2.5-ii-spring-mvc</description>
		<content:encoded><![CDATA[<p>Javier,</p>
<p>There is an SPR mentioned in the posting that was resolved in Spring 2.5.3. Have a look at using ControllerClassNameHandlerMapping instead of SimpleUrlHandlerMapping. The approach works with both @Controller and with XML-based controllers. </p>
<p>For more details see this infoq article:<br />
<a href="http://www.infoq.com/articles/spring-2.5-ii-spring-mvc" rel="nofollow">http://www.infoq.com/articles/spring-2.5-ii-spring-mvc</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Javier Diaz</title>
		<link>http://blog.springsource.org/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/comment-page-1/#comment-121918</link>
		<dc:creator>Javier Diaz</dc:creator>
		<pubDate>Fri, 19 Sep 2008 15:44:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springsource.com/main/2008/03/23/using-a-hybrid-annotations-xml-approach-for-request-mapping-in-spring-mvc/#comment-121918</guid>
		<description>Sorry, here again
      &lt;bean id=&quot;urlMapping&quot; class=&quot;org.springframework.web.servlet.handler.SimpleUrlHandlerMapping&quot; &gt;
        &lt;property name=&quot;mappings&quot;&gt;
            &lt;value&gt;
              /ltb/*.cgi       = ltbController
            &lt;/value&gt; 
        &lt;/property&gt;
    &lt;/bean&gt;

   &lt;bean id=&quot;ltbController&quot; class=&quot;com.lastminute.lfe.dashboard.web.LtbController&quot;&gt;
      &lt;constructor-arg ref=&quot;jdbcSubagentManager&quot;/&gt;
   &lt;/bean&gt;</description>
		<content:encoded><![CDATA[<p>Sorry, here again<br />
      &lt;bean id=&quot;urlMapping&quot; class=&quot;org.springframework.web.servlet.handler.SimpleUrlHandlerMapping&quot; &gt;<br />
        &lt;property name=&quot;mappings&quot;&gt;<br />
            &lt;value&gt;<br />
              /ltb/*.cgi       = ltbController<br />
            &lt;/value&gt;<br />
        &lt;/property&gt;<br />
    &lt;/bean&gt;</p>
<p>   &lt;bean id=&quot;ltbController&quot; class=&quot;com.lastminute.lfe.dashboard.web.LtbController&quot;&gt;<br />
      &lt;constructor-arg ref=&quot;jdbcSubagentManager&quot;/&gt;<br />
   &lt;/bean&gt;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

