views:

42

answers:

1

hi I can t deploy my programm but when I click on submit form nothing happen,my controller is(Create ticket controller)

<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="mappings">
        <props>
            <prop key="index.htm">indexController</prop>
            <prop key="eventHome.htm">eventHomeController</prop>
            <prop key="offsetHome.htm">offsetHomeController</prop>
            <prop key="ticketingHome.htm">ticketHomeController</prop>
            <prop key="searchProject.htm">searchProjectController</prop>
            <prop key="createTicket.htm">createTicketController</prop>
            <prop key="createEvent.htm">createEventController</prop>
            <prop key="listEvent.htm">listEventController</prop>
        </props>
    </property>
</bean>

<bean id="viewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"
      p:prefix="/WEB-INF/jsp/"
      p:suffix=".jsp" />

<!--
The index controller.
-->

<bean name="ticketHomeController"
      class="org.springframework.web.servlet.mvc.ParameterizableViewController"
      p:viewName="ticketing/ticketingHome" />
<bean name="indexController"
      class="org.springframework.web.servlet.mvc.ParameterizableViewController"
      p:viewName="index" />
<bean name="eventHomeController"
      class="org.springframework.web.servlet.mvc.ParameterizableViewController"
      p:viewName="event/eventHome" />
<bean name="offsetHomeController"
      class="org.springframework.web.servlet.mvc.ParameterizableViewController"
      p:viewName="allocation/OffsettingHome" />


<bean name="searchProjectController"
      class="org.hatfrust.eventportal.controller.project.SearchProjectController">
    <property name="formView" value="allocation/searchProject"/>
    <property name="projectService" ref="projectService"/>
</bean>
<bean name="createTicketController"
class="org.hatfrust.eventportal.controller.ticketing.TicketController">
    <property name="commandName" value="ticketBean"/>
    <property name="commandClass" value="org.hatfrust.eventportal.view.ticketing.TicketBean"  />
     <property name="formView" value="ticketing/createTicket"/>
    <property name="successView" value="ticketing/success"/>
    <property name="ticketService" ref="ticketService"/>
</bean>
<bean name="listEventController"
      class="org.hatfrust.eventportal.controller.eventmng.ListEventController">
    <property name="eventService" ref="eventService"/>
    <property name="formView" value="event/listEvent"/>

</bean>




<bean name="createEventController"
      class="org.hatfrust.eventportal.controller.eventmng.EventMngController">
    <property name="commandName" value="EventBean"/>
    <property name="commandClass" value="org.hatfrust.eventportal.view.event.EventBean" />
    <property name="formView" value="event/createEvent"/>
    <property name="successView" value="event/successEvent"/>
    <property name="eventService" ref="eventService"/>
</bean>

here is my controller.........

public class TicketController extends SimpleFormController {

TicketingService ticketService;




@Override
protected ModelAndView onSubmit(HttpServletRequest request,
        HttpServletResponse response,
        Object command, BindException errors) throws Exception {
    TicketBean ticketBean = (TicketBean) command;
    System.out.println("TicketBean=" + ticketBean);




    ticketService.createTicket(Integer.parseInt(String.valueOf(Math.random())),
            ticketBean.getTicketId(),  ticketBean.getEventDate(),
                 ticketBean.getEmail());

    return new ModelAndView(getSuccessView(), "ticketBean", ticketBean);
    }
}
+1  A: 

Spring MVC most assuredly does work. Your code is wrong somewhere.

What you have looks OK. Could be a problem with your JSP. Do you have a form with a POST in your createTicket.jsp?

duffymo
@duffymo yes I have ,I can nt find my error...can I post my code to you?