[s2] LazyDynaBean and ModelDriven interface

2006-12-04 Thread Mark Shifman
Does anybody have an example of using a LazyDynaBean with the 
ModelDriven interface?
http://struts.apache.org/2.x/docs/struts-1-solutions.html implies that 
it should work.


I have a simple action:
public final class MyAction extends ActionSupport implements ModelDriven{
   private LazyDynaBean f;
   public String execute() throws Exception  {
   String my_field = (String)f.get(my_field);
  LOG.fatal(my_myfield); //nothing here :-(
  return SUCCESS;
   }
  
   public Object getModel() {

   return f = new LazyDynaBean();
   }
}

I don't get anything from the LazyDynaBean. 


If I use a simple pojo like
public class myBean {
String my_field;
public String getMy_field() {
   return my_field;
   }

   public void setMy_field(String my_field) {
   this.my_field= my_field
   }

Things work.

What am I missing or doing wrong?
Thanks in advance
mas

--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [s2] LazyDynaBean and ModelDriven interface

2006-12-04 Thread Mark Shifman

Mark Shifman wrote:
Does anybody have an example of using a LazyDynaBean with the 
ModelDriven interface?
http://struts.apache.org/2.x/docs/struts-1-solutions.html implies that 
it should work.


I have a simple action:
public final class MyAction extends ActionSupport implements ModelDriven{
   private LazyDynaBean f;
   public String execute() throws Exception  {
   String my_field = (String)f.get(my_field);
  LOG.fatal(my_myfield); //nothing here :-(

Opps I made a typo for this example should be:
LOG.fatal(my_field);

  return SUCCESS;
   }
 public Object getModel() {
   return f = new LazyDynaBean();
   }
}

I don't get anything from the LazyDynaBean.
If I use a simple pojo like
public class myBean {
String my_field;
public String getMy_field() {
   return my_field;
   }

   public void setMy_field(String my_field) {
   this.my_field= my_field
   }

Things work.

What am I missing or doing wrong?
Thanks in advance
mas




--
Mark Shifman MD. Ph.D.
Yale Center for Medical Informatics
Phone (203)737-5219
[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]