AnsweredAssumed Answered

How to get a value from a Java bean

Question asked by droverflow on Feb 24, 2012
Latest reply on Feb 26, 2012 by roig
Hi all,

I'm trying to create a Java bean and use it inside an expression, but can't figure out how to get it to work…

<activiti:formProperty id="firstName" name="First name" type="string" value="${Person.getFirstname()}" writable="false" />


package beans;

import java.io.Serializable;

public class Person implements Serializable {

   private static final long serialVersionUID = 1L;
   
   private String firstname = "xxx";
   
   public Person() {
      firstname = "xxx";
   }
   
   public void setFirstname() {
      firstname = "xxx";
   }
   
   public String getFirstname() {
      return firstname;
   }
}

1. Do I have to create a .class or a .jar file out of my Java file?
2. In which directory do I have to put the created file?
3. Do I have to configure anything else (e.g. edit a config file)?
4. Do I have to restart Tomcat?
5. Anything else that is important?

I know that these are very basic questions, but unfortunately the Activiti user guide is not very appropriate for beginners… :(

Any help appreciated!

Regards,
Doc

Outcomes