0 Replies Latest reply on Apr 2, 2007 11:53 PM by horikawa yoji

    bean and servlet question

    horikawa yoji Newbie

      hi fellaz.

      I'm developing a web app using JBoss 4.0.5GA and EJB3.0, and facing a prob...

      my setting is as follows:

      //this is just a bean//
      public class ParameterBean implements Serializable{
      private int isSeo = 0;

      public int getIsSeo() {
      return isSeo;
      public void setIsSeo(int isSeo) {
      this.isSeo = isSeo;

      //remote interface.
      //i'm calling this from the servlet.
      public interface AdFlowForMass {
      public ArrayList listMassAds(ParameterBean parameters) ;

      //method detail
      public class AdFlowForMassBean implements AdFlowForMass, Serializable {
      public ArrayList listMassAds(ParameterBean parameters) {

      I call the method as follows from the servlet:

      InitialContext ctx = new InitialContext();
      AdFlowForMass massAdFlow = (AdFlowForMass)ctx.lookup(".../.../remote");
      massAds = massAdFlow.listMassAds(parameters);

      the problem is that when i pass the "parameter" to "listMassAds" from the servlet, "parameter"'s memory reference seems ended in the servlet and new "ParameterBean" is created inside of the "listMassAds" method (all the field values are same, thou).

      so that when i modify "parameter" fields inside of the "listMassAds" method, the servlet's "parameter" values don change.

      I tried to change the JBOSS setting such as "CallByValue=false" but it didn' change a thing.

      i know parameter is not @Entity, but i need to change parameter values as reference...

      How can i pass a bean as referece to EJB methods??