Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First of all, I would suggest that you explore the Struts 2 Spring integration instead of trying to integrate spring into struts 2 yourself. The integration is provided by the Strut 2 Spring plugin. You should check it out; it allows you to easily inject beans into your struts 2 actions, not to mention all other objects created by the framework. <a href="http://struts.apache.org/2.3.4.1/docs/spring-plugin.html" rel="nofollow">Here's a link</a>.</p> <p>But, even based upon what you have in your code snippets, I can provide some clarity on a couple of Spring fundamentals. The bean property as defined by the setter must match the bean property name. Without this, property injection wouldn't work. However, it sounds like you changed the name of the field itself to match; this would be field injection. Completely different mechanisms. I suggest that you really need to understand the concepts of property injection, field injection and constructor injection, as well as the concept of auto-wiring. Sorry, if I'm misassuming that you don't have this stuff dialed; seems like you don't though. </p> <p>HOWEVER, I suggest you have a bigger problem though. There is a dependency cycle in your beans. Consider these two:</p> <pre><code> &lt;bean id="insertUserProfile" class="lotmovement.business.crud.InsertUserProfile"&gt; &lt;property name="registeraction" ref="registeraction"/&gt; &lt;property name="entitystart" ref="entitystart"/&gt; &lt;property name="userprofile" ref="userprofile"/&gt; &lt;/bean&gt; &lt;bean id="registeraction" class="lotmovement.action.RegisterAction"&gt; &lt;property name="insertUserProfile" ref="insertUserProfile"/&gt; &lt;property name="entitystart" ref="entitystart"/&gt; &lt;property name="recordexistuserprofile" ref="recordexistuserprofile"/&gt; &lt;/bean&gt; </code></pre> <p>I don't know for sure whether spring allows this, but if it did it would have to make some arbitrary decision about how the injections go down as it's simply not possible satisfy a cycle in a normal fashion, I think. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload