-
May 13th, 2011, 01:15 AM
#1
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="com.fr.carrefour.portail.carburant.LoginAct ion">
<property name="empService" ref="empLocal"></property>
</bean>
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;
}
-
May 13th, 2011, 03:06 AM
#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.
-
May 13th, 2011, 04:07 AM
#3
Dear martin when I used plugin
I am getting plugin must be declared exception
<action name="login" method="authenticate"
class="com.fr.carrefour.portail.carburant.LoginAct ion">
<result name="success">/CarburantPortailHome.jsp</result>
<result name="error">/login.jsp</result>
<result name="input">/login.jsp</result>
</action>
<plug-in className="org.springframework.web.struts.ContextL oaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/applicationContext.xml"/>
</plug-in>
org.xml.sax.SAXParseException: Element type "plug-in" must be declared.
-
May 13th, 2011, 04:36 AM
#4
Please [ code][/code ] tags exist for a reason
...
Which struts version are you using (and please read the struts configuration guide).
-
May 13th, 2011, 04:52 AM
#5
-
May 13th, 2011, 05:04 AM
#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.
-
May 13th, 2011, 09:05 AM
#7
Hi martyn thanx for ur reply.I solved the issue .
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules