• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

controller with Spring annotation ?

 
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what did you realy want to do?
you could use @RequestParam for binding request parameters to method parameters.

Rgds,
Rendi
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic