Announcement Announcement Module
No announcement yet.
error in SimpleFormController Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • error in SimpleFormController


    I need some help with my Controller which extends an SimpleFormController. My application is deployed in Tomcat 6.0. When I look into the logfiles in Tomcat I can see that the variables written by Log4J has been assigned with correct values. I do that in the method doSubmitAction.

    The next statement to be executed is in my case to create a project which I do in the ProjectService object by the method createProject.

    This is my error;Line 69 is the statement projectService.createProject(projectDao). I don't know why this happens. Maybe someone can help me with this?

    businessLayer.controller.CreateProjectController.d oSubmitAction(
    org.springframework.web.servlet.mvc.SimpleFormCont roller.onSubmit(
    org.springframework.web.servlet.mvc.SimpleFormCont roller.onSubmit(
    org.springframework.web.servlet.mvc.SimpleFormCont roller.onSubmit(
    org.springframework.web.servlet.mvc.SimpleFormCont roller.processFormSubmission(SimpleFormController. java:267)
    org.springframework.web.servlet.mvc.AbstractFormCo ntroller.handleRequestInternal(AbstractFormControl
    org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(
    org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda
    org.springframework.web.servlet.DispatcherServlet. doDispatch(
    org.springframework.web.servlet.DispatcherServlet. doService(
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(
    org.springframework.web.servlet.FrameworkServlet.d oPost(
    javax.servlet.http.HttpServlet.service(HttpServlet .java:637)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)

  • #2
    Your service likely isn't wired up correctly, ie, its not being initialized hence the infamous NPE.


    • #3
      Agreed. Specifically, it looks like you need a projectService set as a property on your controller, and it isn't being set.


      • #4

        In my dispatchere-servlet.xml i have configured a bean name like this;

        <bean name="/createProject.htm" class="businessLayer.controller.CreateProjectContr oller">
        <property name="formView">
        <property name="successView">

        I wonder how to configure my ProjectService as att attribute in this file?