Static methods in class accessed by jsp/servlet

I wanted to conceptually know ...
If I have a class specifically doing some quering to database and giving results to jsp and servlet ... does this make sense? Static methods are ok ? Is it secure enough if I have all connection classes local to a method? can i make the connection global instead without compromising security ?
For example:
public class DatabaseUtility{
public static Sring getUsername(String employeeid)
  Connection conn = ...........
  Statement stmt = ........
rs executes query and gets a username and returns it...
public static Sring getAddress(String employeeid)
  Connection conn = ...........
  Statement stmt = ........
rs executes query and gets a address and returns it...
}

can i make the connection global instead without compromising security ?As long as it was readonly, it should be secure. However as damiansutton said, you open yourself up to a resource bottleneck if you make the connection static, as everyone will be using the same connection.
Most often if you want one piece of information from this DatabaseUtility, you want more than one. Why get a database connection each time? You want to get a DB connection, milk all the info you want from it, and then give it back.
I think you might want to look at having a DataAccessObject: http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html
It is no longer static, but is much more efficient in that it only creates one database connection for all your queries on one request. So anywhere you want to use this, you create a new DatabaseUtility object, and then use it to your hearts content.
Cheers,
evnafets

Similar Messages

  • Static methods in data access classes

    Are we getting any advantage by keeping functions of DAOs (to be accessed by Session Beans) static ?

    I prefer to have a class of static methods that
    require a Connection to do their work. Usually, there
    is a SessionBean that 'wraps' this DAO. The method
    signatures for the SSB are the same, minus the need
    for a Connection, which the SSB gets before delegating
    to the Static Class.Uggh, passing around a connection. I've had to refactor a bunch of code that used this pattern. We had classes in our system that took a class in their constructor simply because one of their methods created an object that needed the connection. Bad news--maintenance nightmare--highly inflexible.
    What we've done is create ConnectionFactory singletons that are used throughtout the application in order to get connections to the database. All connection factory implementations implement the same interface so they can be plugged in from other components at runtime.
    In my opinion, classes that use connections should manage them themselves to ensure proper cleanup and consistent state. By using a factory implementation, we simply provide the DAO classes the means by which they can retrieve connections to the database and even the name of the database that needs to be used that is pluggable. The DAO classes do their own connection management.
    For similar reasons, I eschew the static method concept. By using class methods, you make it difficult to plug in a new implementation at runtime. I much prefer the singleton pattern with an instance that implements a common interface instead of a class full of static methods.
    I recently needed to dynamically plug in new connection factory implementation so that we could use JNDI and DataSources within the context of the application server (pooled connections) but use direct connections via the Driver manager for unit testing (so the application server didn't need to be running). Because of the way this was coded, I simply changed the original factory to be an abstract factory and changed the getInstance() method to return a different implementation based on the environment (unit test vs live). This was painless and didn't require changing a single line of client code.
    If I had to do this using the previous code that I refactored, I would have had to change about 200 jsp pages and dozens of classes that were making calls to the static method of the previous factory or hacked in something ugly and hard to maintain.
    YMMV

  • Dynamic programming accessing static method on classes

    Hi
    I need access to a static method on a class.
    The class name is first decided at runtime.
    How do I do that?
    Regards,
    Morten

    Hello Morten
    Here is a sample program for you:
    *& Report  ZUS_SDN_DYNAMIC_METHOD_CALL
    REPORT  zus_sdn_dynamic_method_call.
    DATA: go_msglist    TYPE REF TO if_reca_message_list.
    DATA: gd_method     TYPE tmdir-methodname,
          gd_class      TYPE seoclsname.
    START-OF-SELECTION.
      IF ( 1 = 2 ).
        CALL METHOD cf_reca_message_list=>create
    *      EXPORTING
    *        id_object    = 'RECA'
    *        id_subobject = 'MISC'
    *        id_extnumber =
          RECEIVING
            ro_instance  = go_msglist.
        go_msglist = cf_reca_message_list=>create( ).
      ENDIF.
      gd_class  = 'CF_RECA_MESSAGE_LIST'.
      gd_method = 'CREATE'.
      CALL METHOD (gd_class)=>(gd_method)
        RECEIVING
          ro_instance = go_msglist.
      IF ( go_msglist IS BOUND ).
        WRITE: / 'Class is bound'.
      ELSE.
        WRITE: / 'Class is NOT bound'.
      ENDIF.
    END-OF-SELECTION.
    Obviously, that is only half of the task. You need to make the method signature dynamically as well.
    Regards
      Uwe

  • Static methods inside class in jsp can't make it work

    Hello all i can't understand it why i can't declare the method as static method ?
    public class Request{
              Request(){}
              private String paramValue;
              public static String getRequestParam(HttpServletRequest request, String paramName, String defaultValue){
                   paramValue = request.getParameter(paramName);
                   return paramValue != null ? paramValue : defaultValue;
    im geting this error :
    The method getRequestParam cannot be declared static; static methods can only be declared in a static or top level type
    can't i do inner class ?
    or other sulotion for me not to make instences of class's but to use the class static methods?

    Hi, try this:
    public class Request{
              Request(){}
              private static  String paramValue;
              public static String getRequestParam(HttpServletRequest request, String paramName, String defaultValue){
                   paramValue = request.getParameter(paramName);
                   return paramValue != null ? paramValue : defaultValue;
          }it should work. the problem in you code is that you are trying to referance an non-static object with a static one!
    Message was edited by:
    Adelx

  • Can't get EntityManager access in JSP/Servlet

    Hi all,
    our team has started a EJB project (EJBs + JPA configurations)
    we managed to access the configured JPA (EntityManager etc) within the EJB instance; however we don't know how to access the EntityManager within JSP/Servlet
    Our project's structure:
    1 EJB project (EJB classes, EntityBean classes, JPA configuration + eclipselink)
    1 Web project (for JSP, Servlets)
    the main problem is ... we can't access EntityManager(s) in JSP / Servlets (and we already tried using Struts2.0 to replace servlets/jsp... the problem is the same... so it is not ... the matter of choosing the view technology...)
    Jason

    Hi Jason,
    How i tried to get EntityManager is as following:
    Suppose I want to define my Persistence unit like Following:
    *<Your-EAR>/APP-INF/classes/MyEmployee.java*
    "*MyEmployee.java*"
    package entityA;
    import java.io.Serializable;
    import org.apache.commons.lang.builder.EqualsBuilder;
    import org.apache.commons.lang.builder.HashCodeBuilder;
    import org.apache.commons.lang.builder.ToStringBuilder;
    import javax.persistence.*;
    @Entity()
    @Table(name="MYEMPLOYEE")
    public class MyEmployee implements Serializable {
         //default serial version id, required for serializable classes.
         private static final long serialVersionUID = 1L;
         private Long empno;
         private String empname;
    public MyEmployee() {
         @Id()
         @Column(name="EMPNO", unique=true, nullable=false, precision=22)
         public Long getEmpno() {
              return this.empno;
         public void setEmpno(Long empno) {
              this.empno = empno;
         @Basic()
         @Column(name="EMPNAME", length=15)
         public String getEmpname() {
              return this.empname;
         public void setEmpname(String empname) {
              this.empname = empname;
         public boolean equals(Object other) {
              if (this == other) {
                   return true;
              if (!(other instanceof MyEmployee)) {
                   return false;
              MyEmployee castOther = (MyEmployee)other;
              return new EqualsBuilder()
                   .append(this.getEmpno(), castOther.getEmpno())
                   .isEquals();
         public int hashCode() {
              return new HashCodeBuilder()
                   .append(getEmpno())
                   .toHashCode();
         public String toString() {
              return new ToStringBuilder(this)
                   .append("empno", getEmpno())
                   .toString();
    And I have Placed My "*persistence.xml*" file in *"<Your-EAR>/APP-INF/classes/META-INF/persistence.xml"*
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence xmlns="http://java.sun.com/xml/ns/persistence"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
         version="1.0">     
         <persistence-unit name="JPA_A_EJB" transaction-type="RESOURCE_LOCAL">
              <provider>org.hibernate.ejb.HibernatePersistence</provider>
              <class>entityA.MyEmployee</class>
              <properties>
                   <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
                   <property name="hibernate.connection.driver_class" value="oracle.jdbc.OracleDriver"/>
                   <property name="hibernate.connection.url" value="jdbc:oracle:thin:@localhost:1521:xe"/>
                   <property name="hibernate.connection.username" value="jack"/>
                   <property name="hibernate.connection.password" value="password"/>
              </properties>
         </persistence-unit>     
    </persistence>
    ***********************************HOW I Access The Above Unit from my EJB mentioned Below*******************************
    "*EmployeeSessionBean.java*"
    package sfsbA;
    import entityA.*;
    import javax.ejb.*;
    import javax.persistence.*;
    @Stateless
    public class EmployeeSessionBean implements EmployeeSessionRemoteIntf
    *@PersistenceContext*
    protected EntityManager entityManager;
    *///NOTE: Using the Above Technique You can access the "EntityManager" Object in your Servlets As well...Just write the Above two Lines inside your Servlet*
    public void createEmployee(Long empno,String empname) throws Exception{
              System.out.println("\n\tcreateEmployee() called. EntityManager entityManager = "+entityManager);
              MyEmployee employee = new MyEmployee();
    employee.setEmpno(empno);
    employee.setEmpname(empname);
    entityManager.persist(employee);
              System.out.println("\n\t Entity Manager has persisted the Employee Information...");
    int count = 0;
    public EmployeeSessionBean() {
    System.out.println("\n\t EmployeeSessionBean--> EmployeeSessionBean() invoked");
    @Init("create")
    public void initMethod() throws CreateException {
    System.out.println("\n\t EmployeeSessionBean--> public void initMethod() invoked");
    @Remove(retainIfException=true)
    public void removeWithRetain() throws Exception{
    System.out.println("\n\t EmployeeSessionBean--> removeWithRetain() invoked");
    @Remove
    public void removeWithoutRetain() throws Exception{
    System.out.println("\n\t EmployeeSessionBean--> removeWithoutRetain() invoked");
    public String printRemoteIntf () {
    System.out.println("\n\t EmployeeSessionBean ---> public String printRemoteIntf () invoked");
         return "ReplicableSFSRemoteObjectIntf";
    public String printLocalIntf () {
    System.out.println("\n\t EmployeeSessionBean ---> public String printLocalIntf () invoked");
         return "ReplicableSFSLocalObjectIntf";
    public String printBean () {
    System.out.println("\n\t EmployeeSessionBean ---> public String printBean () invoked");
         return "EmployeeSessionBean";
    public int testIncrement() throws Exception
    System.out.println("\n\t EmployeeSessionBean ---> public int testIncrement() invoked");
    count=count+5;
    return count;
    public int testDecrement() throws Exception
    System.out.println("\n\t EmployeeSessionBean ---> public int testDecrement() invoked");
    count=count-2;
    return count;
    public int getCount() throws Exception
    System.out.println("\n\t EmployeeSessionBean ---> public int getCount() invoked");
    return count;
    "*EmployeeSessionRemoteIntf.java*"
    package sfsbA;
    public interface EmployeeSessionRemoteIntf {
    public void createEmployee(Long emono,String empname)     throws Exception;
    public void removeWithRetain()throws Exception;
    public void removeWithoutRetain() throws Exception;
    public String printBean ();
    public int testIncrement() throws Exception;
    public int testDecrement() throws Exception;
    public int getCount() throws Exception;
    *"ejb-jar.xml"*
    <?xml version="1.0" encoding="UTF-8"?>
    <ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
    <enterprise-beans>
    <session>
    <ejb-name>EmployeeSessionBean</ejb-name>
    <business-remote>sfsbA.EmployeeSessionRemoteIntf</business-remote>
    <ejb-class>sfsbA.EmployeeSessionBean</ejb-class>
    <session-type>Stateless</session-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    *"weblogic-ejb-jar.xml"* (I am writing these file Just because i want my Own JNDI Simple name...Not the Container Generated Complex JNDI name)
    <weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/90" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd">
    <weblogic-enterprise-bean>
    <ejb-name>EmployeeSessionBean</ejb-name>
    <stateless-session-descriptor>
         <business-interface-jndi-name-map>
    <business-remote>sfsbA.EmployeeSessionRemoteIntf</business-remote>
    <jndi-name>EmployeeSessionBean</jndi-name>
         </business-interface-jndi-name-map>
    </stateless-session-descriptor>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    "*application.xml*"
    <!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'>
    <application>
    <display-name>JPAs_Demo_Jason</display-name>
    <module>
    <ejb>AccessEntityManager.jar</ejb>
    </module>
    </application>
    NOTE: The Jar "" Contains
    1). EmployeeSessionBean
    2). EmployeeSessionRemoteIntf
    3). META-INF/ejb-jar.xml
    4). META-INF/weblogic-ejb-jar.xml
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com  (Real WebLogic Stuff...Not less Than a Magic...Here)
    Edited by: Jay SenSharma on Dec 16, 2009 10:59 PM
    Edited by: Jay SenSharma on Dec 16, 2009 11:00 PM

  • I really need abstract static methods in abstract class

    Hello all.. I have a problem,
    I seem to really need abstract static methods.. but they are not supported.. but I think the JVM should implement them.. i just need them!
    Or can someone else explain me how to do this without abstract static methods:
    abstract class A {
    abstract static Y getY();
    static X getX() {
        // this methods uses getY, for example:
        y=getY();
       return new X(y); // or whatever
    class B extends A {
    static Y getY() { return YofB; }
    class C extends A {
    static Y getY() { return YofC; }
    // code that actually uses the classes above:
    // these are static calls
    B.getX();
    A.getX();I know this wont compile. How should i do it to implement the same?

    Damn i posted this in the wrong thread.. anyways.
    Yes offcourse i understand abstract and static
    But i have a problem where the only solution is to use them both.
    I think it is theoretically possible ot implement a JVM with support for abstract static methods.
    In fact it is a design decision to not support abstract static methods.. thats why i am asking this question.. how could you implemented this otherwise?
    There is an ugly soluition i think: using Aspect Oriented Programming with for example AspectJ.. but that solution is really ugly. So anyone has an OO solution?

  • What's wrong with static methods?

    Answers on an postcard please.

    I think the point here is that sometimes people come from a procedural background (or maybe no background) and they start with main, and one static method leads to another. They reach a tipping point where they are reluctant to define non-static methods to a class because it's all static elsewhere. And static method can't access instance data, so their data becomes largely static as well. When the dust settles, they are programming procedually in Java. So too many static methods is a sign that you may be programming procedurally instead of doing OOP, but using static appropriately is still cool.
    And let's not get pedantic. What goes wrong if I make my String class's getLength method static?
    public final class MyString {
        private int length;
        public static int getLength(String s) {
            return s.length;
    }It's a misuse of static, but it doesn't break my design.

  • Static methods, what for?

    What are static methods for? is there something that is not possible through methods associated with instances (non-static methods) ?

    There are many examples of static mehods in the Java API. For example the Math or the System class. All methods in this classes are static. So you dont have to instantiate the system class. In fact it is even not possible to instantiate the System class. System is final and all Constructors are private.
    Another use for static methods is the access to private static variables.

  • Static Method Mystry

    Static methods are class spacific

    By mistake First message was posted by me Sorry........
    Static methods are class spacific these methods are not overridable by sub class,
    But if i write
    class Super{
    public static void printFunction(){
    System.out.println("In Super Class Method");
    public class SubClass extends Super{
    private static void printFunction(){
    System.out.println("In Super Class Method");
    }compiler gives me error
    c:>javac SubClass.java
    SubClass.java:12: printFunction() in SubClass cannot override printFunction() in
    Super; attempting to assign weaker access privileges; was public
    private static void printFunction(){
    1] Why he is trying to override the printFunction() Which is static?
    2] if it is not overriding then why this error comes?
    Edited by: rahul_p on Apr 28, 2008 7:45 AM

  • NEED HELP WITH USING STATIC METHOD - PLEASE RESPOND ASAP!

    I am trying to set a value on a class using a static method. I have defined a servlet attribute (let's call it myAttribute) on my webserver. I have a serlvet (let's call it myServlet) that has an init() method. I have modified this init() method to retrieve the attribute value (myAttribute). I need to make this attribute value accessible in another class (let's call it myOtherClass), so my question revolves around not knowing how to set this attribute value on my other class using a static method (let's call it setMyStuff()). I want to be able to make a call to the static method setMyStuff() with the value of my servlet attribute. I dont know enough about static member variables and methods. I need to know what to do in my init() method. I need to know what else I need to do in myServlet and also what all I need in the other class as well. I feel like a lot of my problems revolve around not knowing the proper syntax as well.
    Please reply soon!!! Thanks in advance.

    class a
    private static String aa = "";
    public static setVar (String var)
    aa = var;
    class b
    public void init()
    a.aa = "try";
    public static void main(String b[])
    b myB = new b ();
    b.init();
    hope this help;
    bye _drag                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Static method vs synchronisation

    Hi,
    A fundamental query.
    If i am declaring a method as static, can i also declare it as sunchronized? i.e. can i have something like
    public static synchronized sss(){
    xxx
    If a method is static, there is only one instance in the memory. Correspondingly, only one client can execute it at a time. in which case it is automatically synchronized.
    Pl correct my reasoning.
    When do we have the requirement of having a static method, or probably a singleton??
    Thanks,
    Prashant Gupta

    Hi,
    A fundamental query.
    If i am declaring a method as static, can i also declare it as sunchronized? i.e. can
    i have something like
    public static synchronized sss(){
    xxx
    }?Yes, static methods can be synchronized which means that when any thread is running within a synchronized static method of class C, no other thread may enter a static synchronized method of that class. In other words, the monitor acquired by a static synchronized method is the Class itself while the monitor acquired by a non-static synchronized method is the object refered to by 'this'.
    If a method is static, there is only one instance in the memory. Correspondingly,
    only one client can execute it at a time. in which case it is automatically synchronized.There is (in most circumstances) a single copy of the definition (bytecodes representing all methods - static or not - and static fields) of of a class. However, any number of threads may be executing within any section of code unles that code is guarded by a synchronized block or within a synchronized method. In that case, no two threads can enter (well, actually be runnable within - Object.wait() has special implications) a synchronized block monitored by the same object.
    When do we have the requirement of having a static method, or
    probably a singleton??Not sure what you are asking here. You define static methods when there is behavior you want to implement that does not need to have access to instance (non-static) fields or methods and which would never need to be overridden (for purposes of polymorphism) by derived classes.
    Wen needing a singleton, you have a choice of defining a "true singleton" (i.e. a class with a private constructor, some sort of static getInstance() method, with the bulk of its methods anf fields are non-static) or defining a class whose methods are all static and whose fields are also all static. Singletons. Use the one that fits you needs the best.
    Chuck

  • How to call a static method from an event handler

    Hi,
       I'm trying to call a static method of class I designed.  But I don't know how to do it.  This method will be called from an event handler of a web dynpro for Abap application.
    Can somebody help me?
    Thx in advance.
    Hamza.

    To clearly specify the problem.
    I have a big part code that I use many times in my applications. So I decided to put it in a static method to reuse the code.  but my method calls functions module of HR module.  but just after the declaration ( at the first line of the call function) it thows an exception.  So I can't call my method.

  • Using static methods to instantiate an object

    Hi,
    I have a class A which has a static method which instantiates it. If I were to instantiate the class A twice with it's static method within class B then you would think class B would have two instances of class A, right?
    Example:
    class A
       static int i = 0;
       public A(int _i)
           i = _i;
       public static A newA(int _i)
            return new A(_i);
    class B
        public B()
            A.newA(5);
            A.newA(3);
            System.out.println(A.i);
        public static void main(String[] args)
            B b = new B();
    }Is there really two instances of class A or just one? I think it would be the same one because if you check the int i it would be 3 and not 5. Maybe static instantiated objects have the same reference within the JVM as long as you don't reference them yourself?
    -Bruce

    It
    seems like you are the only one having trouble
    understanding the question.Well I was only trying to help. If you don't want any help, its up to you, but if that's the case then I fail to see why you bothered posting in the first place...?
    Allow me to point out the confusing points in your posts:
    you would think class B would have two
    instances of class A, right?The above makes no sense. What do you mean by one class "having" instances of another class? Perhaps you mean that class B holds two static references to instances of Class A, but in your code that is not the case. Can you explain what you mean by this?
    Is there really two instances of class
    A or just one?You have created two instances.
    >I think it would be the same one because if you
    check the int i it would be 3 and not 5.
    I fail to see what that has to do with the number of instances that have been created...?
    Maybe static instantiated objects have the
    same reference within the JVM as long as you
    don't reference them yourself????? What is a "static instantiated object"? If you mean that it was created via some call to a static method, then how is it different to creating an object inside the main method, or any other method that was called by main? (i.e. any method)
    What do you mean by "the same reference within the JVM"? The same as what?
    What happened to the first call "A.newA(5)"?
    I think it was overidden by the second call
    "A.newA(3)".As i already asked, what do you mean by this?
    If you change the line for the constructor
    in A to i = i * i you will get "9" as the
    output, if you delete the call "A.newA(3)"
    you will get "25" as the output. Yes. What part of this is cauing a problem?

  • Can't get ClassLoader from static method.

    I'm trying to get the ClassLoader within a static method getInstance().
    public class PropertyManager {
    public static PropertyManager getInstance(String fileName) {
    //The following line returns null
    ClassLoader cl = (new Object()).getClass().getClassLoader();
    URL url = cl.getResource(fileName);
    etc...
    However if getInstance gets called from e.g. a statless session bean, a null
    is returned instead of a valid ClassLoader.
    The same code executed from a standalone java program (e.g. from
    main(String[] args)) returns a valid ClassLoader
    Why does getClassLoader behave differently in WebLogic than in a standalone
    java program?
    Thanks for you help.
    Bernie

    Sorry for the confusion. I wrote a couple of more test programs and was able
    to confirm that WL behaves exacltly the same as java does. For some reason
    my intial tests were messed up...
    getClassLoader() executed from a static method always returns null (in WL as
    well as in a java standalone program).
    In this case ClassLoader.getSystemClassLoader() will return a valid class
    loader.
    Thanks for your help.
    Bernie
    "Rob Woollen" <[email protected]> wrote in message
    news:[email protected]..
    Bernhard Lenz wrote:
    I tried that as well, but getClassLoader() still returns null when
    executed
    in WL.
    I'm still not clear how getClassLoader() gets affected by running withinWL.
    >>
    >
    Very odd. Where is this class located? in the server's classpath, in ajar or
    war file? Does getClass().getClassLoader work from a non-static method inthis
    class?
    -- Rob
    "Rob Woollen" <[email protected]> wrote in message
    news:[email protected]..
    You want PropertyManager.class.getClassLoader()
    -- Rob
    Bernhard Lenz wrote:
    I'm trying to get the ClassLoader within a static method
    getInstance().
    >>>>
    public class PropertyManager {
    public static PropertyManager getInstance(String fileName) {
    //The following line returns null
    ClassLoader cl = (new Object()).getClass().getClassLoader();
    URL url = cl.getResource(fileName);
    etc...
    However if getInstance gets called from e.g. a statless sessionbean, a
    null
    is returned instead of a valid ClassLoader.
    The same code executed from a standalone java program (e.g. from
    main(String[] args)) returns a valid ClassLoader
    Why does getClassLoader behave differently in WebLogic than in astandalone
    java program?
    Thanks for you help.
    Bernie

  • Campaigns with static method

    I have two questions regarding campaign
    1)I have configured campaign for update events of content.
    which will call static method of one class.but when any update occur in repository,exception comes for static method's class not found.
    2)How to avoid stop date in campaign.so that it will run always.
    Can anybody help me on the same

    Since the campaigns run in the enterprise app classloader, anything called by the campaign needs to run in this classloader as well (APP-INF/lib). You could perhaps promote the code you want to call from the campaign from the web-app classloader to the enterprise-app classloader if you want it to be called.
    Code in the enterprise-app classloader (APP-INF/...) can be called by code in the web-app classloader (WEB-INF/...) but not vice-versa. So it shouldn't be an issue to move the code to the ent-app classloader, and it can then be called by both the campaign as well as existing web-app code.
    -Steve

Maybe you are looking for

  • Mail wont open with software update

    Ever since I updated my software my mail wont open and it says it cant run with the latest version... any ideas?

  • Adobe Premiere Pro: place image sequence in reverse order on timeline

    Hi all, I have a jpg image sequence numbered from frame000 to frame100. It imports in numerical order...obviously. I am trying to find a way of dragging the files onto the timeline so they begin at frame and descend in order. Shift clicking in the di

  • How to recover deleted SMS

    So a friend was looking at some old texts from my girlfriend that mean a lot to me and she erased the conversation on accident. If I restore my iPhone in iTunes will it return all my texts to what they were at my last sync?? Thanks in advance

  • How to create a forum for a website?

    Can i create a forum using JSP? I prefer MS SQL2000 database. This forum is for a website that has only static content. Your inputs will be very helpful. Thanks, Madhu.

  • Ipad2 not finding networks

    I just bought a brand new ipad2, and so far I cannot connect to any networks.  Well not only not connect - it won't even show me a list of networks. In fact the wifi 'on' icon refuses to stay 'on' - and keeps switching to 'off'. I have tried this at