Skip to content

Instantly share code, notes, and snippets.

View werpu's full-sized avatar
🏠
Working from home

Werner Punz werpu

🏠
Working from home
  • Irian GmbH
  • Linz, Austria
View GitHub Profile
public class TestClass {
public TestClass(Closure closure) {
closure.setDelegate(this);
closure.run();
}
}
public static void main(String [] main) {
TestClass bla = new TestClass() {
helloWorld = "aaa";
};
}
public static void main(String [] main) {
TestClass bla = new TestClass();
bla['helloWorld'] = "aaa"
}
public static void main(String [] main) {
TestClass bla = new TestClass(helloWorld:"ccc");
print bla.helloWorld;
}
List retVal = new LinkedList();
def component = new Component() {
basepackage = "org.apache.myfaces.dojo.custom.form.textarea";
tagname = "dijitTextarea";
componentclass = "TextArea";
tagclass = "TextAreaTag";
renderclass = "TextAreaRenderer" ;
renderbaseclass = "org.apache.myfaces.dojo.custom.base.DijitInputRenderer";
tagbaseclass = "org.apache.myfaces.dojo.custom.base.DijitInputTag";
componentbaseclass = "org.apache.myfaces.dojo.custom.base.DijitInput";
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.2rc0</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
@werpu
werpu / ScalaElResolver.scala
Created July 7, 2011 13:42
Scala EL Resolver for JSF
import javax.el.{ELContext, ELResolver}
import java.beans.FeatureDescriptor
import java.lang.reflect.Method
import collection.JavaConversions._
import collection.mutable.HashSet
import org.extrasapache.myfaces.codi.examples.ebean.support.lang.ReflectUtil
/**
*
@ManagedBean
public class TestBean implements Serializable {
List<Person> _personList = new LinkedList();
Integer _val1 = 1;
public List<Person> getPersonList() {
return _personList;
}
public void setPersonList(List<Person> personList) {
@werpu
werpu / TestBean.scala
Created July 8, 2011 07:34
Scala example
import reflect.BeanProperty
import java.util.LinkedList
@serializable
@ManagedBean
class TestBean {
@BeanProperty
var personList = new LinkedList[Person]
@BeanProperty
var val1 = 1
@werpu
werpu / TestBean.scala
Created July 8, 2011 07:47
TestBean with CDI
import reflect.BeanProperty
import java.util.LinkedList
import javax.inject.Named
@serializable
@Named
class TestBean {
@BeanProperty
var personList = new LinkedList[Person]
@BeanProperty