• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts 2 - Springs Integration.

 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I'm using struts-2 with Spring. In struts-2, we inject the user input directly to the bean from JSP and creating private member of that Bean in Action Class. After that, We create Model class by writing code like


After that we call required model Methods.

But using springs, No need to create "new" simply by registering all classes in applicationContext.xml. Can I inject user-inputs from applicationContext.xml to bean instead of bean directly? If can't, Then spring's used only to create new instance of Model with dependency injection?

First I've to do as usual like injecting directly to Bean from jsp, then to create only model instance, I've to use spring? What's the use of BEAN? I know bean is a POJO we can send bean to different layers without problems (like object passing without depending on any of the layers/frameworks, But in this case how? We are not passing anything, applicationcontext.xml is doing all the things. Please clarify my doubts step by step.

Thanks:
Ramakrishna K.C
 
Ramakrishna Udupa
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody explain this CODE properly.. I'm not getting what's happening inside please... OR Explain how struts2 - Spring Integration works step by step...

Thanks:
Ramakrishna K.C

 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you be more specific about what you do not understand? The plugin used for Struts 2/Spring integration has documentation. Have you looked at it?

Find it here:
http://struts.apache.org/release/2.0.x/docs/spring-plugin.html
 
Ramakrishna Udupa
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bill Gorder,

I dint understand the struts-2/spring control flow according to the standard MVC. Controller is blackbox it transfers to struts.xml, but in that blackbox we specify the spring listener class. I want to know the control flow. I saw that link. But, dint satisfy. When spring.xml will get trigger and after it initializes the bean, where the control flow goes ? interceptors triggers before spring.xml or after? Please provide or explain step by step process and control flow in spring/struts-2 integration.

Thanks:
Ramakrishna K.C
 
reply
    Bookmark Topic Watch Topic
  • New Topic