Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

flow of BeanNameUrlHandlerMapping in spring

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
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>
</bean>
 
Villains always have antidotes. They're funny that way. Here's an antidote disquised as a tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!