Announcement Announcement Module
No announcement yet.
Problem in loading Applciation Contenxt in a POJO Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem in loading Applciation Contenxt in a POJO

    I am developing a project which was build in Spring MVC. Here spring application context is loaded using ContextLoaderListener class.Everything is running fine.
    In application context there is a bean looked like following
    <bean id="emailService" class="com.project.service.emailServiceImpl">
    <property name="serverEmailId" value="${}"></property>
    <property name="serverEmailPassword" value="${email.password}"></property>
    <property name="outGoingServer" value="${email.outgoingserver}"></property>
    where property values are loaded from a property file.
    Now I am using a jar which instantiate this class like
    emailService e=new emailServiceImpl();
    thats why I am not getting all those property values loaded by Spring application Context.Since I cant modify the jar file because I have no source code of that JAR so i decided to modify my emailService class constructor so that if any class instantiate it then it will provide all those property value that are set by application context.
    Now can anybody tell me how to set all those property values to the emailService class by instantiatiating it rather setting from SpringApplcaitonContext.xml.
    So is it possible for Spring to give me all those property value when i instantiate the class??