• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
  • salvin francis
  • Piet Souris

flow of BeanNameUrlHandlerMapping in spring

Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am spring biggner and trying to hand on by reading material available on net.
As i read BeanNameUrlHandlerMapping , I tried it with one example ,but its not working.
As per my understanding the flow should be like
1.request travels in web.xml and see the DispatcherServlet
2.this front controller lead it to proper controller defined in <application>-servlet.xml file by the help of HandlerMappling.
in my case i am using BeanNameUrlHandlerMapping so it will fetch mapping string from request url and match it in <application>-servlet.xml> to fetch appropriate controller.In my case it is "CreateContactController.java"
3.As request goes to appropriate controller,controller checks the request ,call constructors and then display view page ,defined in formView tag.
4.commandClass tag is pogo class which is used to set all getter setter property defined in view form.
5.As user click on submit button , controller comes up and call the doSubmitAction() method to fetch the services from java class which is defined in commandService tag.
6.After completing step 5 ,if everything is succes then it calls success jsp defined in successView tag.

This is my understaing ,i am not sure wheter it is correct or not pls let me know am i correct ???
one more doubt , in my following code ,CreateContactController role how many time come existence ???only after submit action or before it too ???

Thanks in advance

<bean name="/CreateContact.htm" class="com.CreateContactController">
<property name="formView"><value>CreateContact</value></property>
<property name="successView"> <value>ContactCreated</value> </property>
<property name="commandClass"><value>test.Contact</value></property>
<property name="commandName"><value>MyCommandName</value></property>
<property name="contactService"><value>test.ContactService</value></property>
Stinging nettles are edible. But I really want to see you try to eat this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!