Announcement Announcement Module
No announcement yet.
Plz provide solution for setting the object through IOC..No replies are cming Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Plz provide solution for setting the object through IOC..No replies are cming

    Unable to set the property from context.xml not creating the object in setters method
    Container is not reading the properties from the context.xml which I placed paralled to webinf and imported from applicationContext.xml.Seetters and getters are not cming.control in not cming to setters method of my class while deploying.even if I type the wrong class in xml container is not throwing any exceptions plz help.

    my context.xml

    <bean id="login" scope="prototype" class=" ion">
    <property name="empService" ref="empLocal"></property>

    I imported it from applicationcontext.xml

    <import resource="actions-context.xml"/>

    the setters and getters in my class are

    private IEmployeeService empService;

    public IEmployeeService getEmpService() {
    return empService;

    public void setEmpService(IEmployeeService empService) {
    this.empService = empService;

  • #2
    For starters use [ code][/code ] tags when posting code.

    Next simply creating xml files, dropping them in the WEB-INF directory isn't going to get them loaded. Also next to that make sure you are using the beans defined in your context that you are not creating new instances. It appears as you are using struts, I suggest a read of the struts integration chapter of the reference guide.


    • #3
      Dear martin when I used plugin
      I am getting plugin must be declared exception

      <action name="login" method="authenticate"
      class=" ion">
      <result name="success">/CarburantPortailHome.jsp</result>
      <result name="error">/login.jsp</result>
      <result name="input">/login.jsp</result>


      <plug-in className="org.springframework.web.struts.ContextL oaderPlugIn">
      <set-property property="contextConfigLocation"

      org.xml.sax.SAXParseException: Element type "plug-in" must be declared.


      • #4
        Please [ code][/code ] tags exist for a reason ...

        Which struts version are you using (and please read the struts configuration guide).


        • #5
          I am using struts2.0


          • #6
            Struts 2.0 has its own integration (the spring stuff is for 1.x)... So I suggest reading the struts documentation on how to use spring with struts 2.


            • #7
              Hi martyn thanx for ur reply.I solved the issue .