It's not a secret anymore!*
The moose likes Spring and the fly likes  controller with Spring annotation ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark " controller with Spring annotation ?" Watch " controller with Spring annotation ?" New topic
Author

controller with Spring annotation ?

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
I write a controller with Spring annotation.

Below is the coding, when server starts up, I can see output in console " org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/user.do] onto handler [com.web.UserController@9e8c34]"

then, when I type "http://localhost:8080/SpringAnotation/user.do?cmd=showUserForm", it will not invoke that method, no any debug information shown in console.

Do I need any other setup in dispatcher-servlet.xml except "context:component-scan" ?

Thanks.

Rendi Artha
Greenhorn

Joined: Jan 20, 2010
Posts: 29
what did you realy want to do?
you could use @RequestParam for binding request parameters to method parameters.

Rgds,
Rendi
Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
Rendi Artawijaya wrote:what did you realy want to do?
you could use @RequestParam for binding request parameters to method parameters.


I need migrate Spring 2.0 to 3, the old one is multiaction controller, defined as below.


Here, the 'cmd' is paramName, so when I type "/case.do?cmd=saveNew", it should go to that method. Now I need use Annotation to achieve this.

Thanks.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: controller with Spring annotation ?