<bean name="/hello.htm" class="mySpringPrj.web.InventoryController">
<property name="productManager" ref="productManager"/>
</bean>
is it mandatory to implement a class for a jsp ?
Handling Requests:
When a request comes to the DispatcherServlet, you may want to take it through different stages. In this framework, you can configure handlers to do this. There are many handlers available that can be used by providing handler mappings. Since you want to take the request through different process steps, the handler must be able to process the request for a definite task and forward the request to next handler in chain. For this it must also contain the list of handlers applied to this request.
BeanNameUrlHandlerMapping: Extends from AbstractHandlerMapping. Maps incoming HTTP request to the bean names configured in application context i.e. as a bean name, in application context, we give url and the bean is of a controller. Thus the url is mapped to a controller.<bean name=”/saveCustomer.htm” class=”com.myorg.springmvctutorial.web.controller.SaveCustomerController”/>
SimpleUrlHandlerMapping: Extends from AbstractHandlerMapping. More powerful and supports Ant-style url mapping. This mapping we configure at two places. In web.xml we define the url pattern supported.<servlet-mapping>
<servlet-name>springmvctutorial</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
In application context xml, we map the urls to controller definitions.
<bean class=”org.springframework.web.servlet.handler.SimpleUrlHandlerMapping”>
<property name=”mappings”>
<value>
/*/saveCutomer.htm= saveCustomerController
</value>
</property>
</bean>HandlerIntercepter: Implementer of this intercept can implement three methods of this intercepter, one that is called before the actual handler execution, second after the handler execution and last one after the complete request processing. Handlers can be configured using SimpleUrlHandlerMapping configuration in application context.I am sending to you one example check that attachmentRegards,Rajnish
--
You received this message because you are subscribed to the Google Groups "Bangalore Open Java Users Group- BOJUG" group.
To post to this group, send email to bo...@googlegroups.com.
To unsubscribe from this group, send email to bojug+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bojug?hl=en.
Handling Requests:
When a request comes to the DispatcherServlet, you may want to take it through different stages. In this framework, you can configure handlers to do this. There are many handlers available that can be used by providing handler mappings. Since you want to take the request through different process steps, the handler must be able to process the request for a definite task and forward the request to next handler in chain. For this it must also contain the list of handlers applied to this request.
<bean name=”/saveCustomer.htm” class=”com.myorg.springmvctutorial.web.controller.SaveCustomerController”/>
<servlet-mapping>
<servlet-name>springmvctutorial</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
In application context xml, we map the urls to controller definitions.
<bean class=”org.springframework.web.servlet.handler.SimpleUrlHandlerMapping”>
<property name=”mappings”>
<value>
/*/saveCutomer.htm= saveCustomerController
</value>
</property>
--
<bean name="/partyForm.htm" class="TallyPrj.web.PartyController">
<property name="sessionForm" value="true"/>
<property name="commandName" value="addParty"/>
<property name="commandClass" value="TallyPrj.form.Party"/>
<property name="formView" value="partyForm"/>
<property name="successView" value="hello.htm"/>
<property name="productManager" ref="productManager"/>
</bean>
<bean name="/account.htm" class="TallyPrj.web.AccountController">
<property name="productManager" ref="productManager"/>
</bean>
that will call AccountController class ( having below code)
String now = (
new java.util.Date()).toString(); logger.info("returning hello view with " + now);Map<String, Object> myModel =
new HashMap<String, Object>();myModel.put(
"parties", this.productManager.getPartyList()); return new ModelAndView(new RedirectView("/partyForm"), "model", myModel);}
but now it is showing :: HTTP 404 The requested resource (/partyForm) is not available.
I tried in many ways .. but its not coming.
Any help in this regard will be appreciable.
Thanks in advance
shweta