• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[SimpleFormController] first use, getting a NULL command object.

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm working Simple Search use case on a web application using spring MVC(Spring framework 2.5.6) , but I'm getting a Null Pointer Exception during the last 24h, I'm not able to solve it by myself, please help me.

It's the first time using Spring MVC, so here is how i use the SimpleFormController


My application context file:


My jsp page

this is the tail of my catalina.out file .. What i got here is that the object command passed to onSubmit is NULL, why ? where am I going wrong ?

 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not that this will help solve your current problem.

But if you are learning Spring MVC and this is not a legacy application already written. Then I highly recommend learning more up to date Spring MVC. Since Spring 2.5 and therefore Spring MVC 2.5 it is more recommended to use Annotation mapping and not implement any Spring interface, including the Spring Controller interfaces. Your Controllers should be POJOs instead and mapped with @RequestMapping.

It is much simpler to use the annotation approach. So much that in the most current versions of Spring and Spring MVC the Controller interfaces are deprecated.

Good Luck

Mark
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic