标签:des style http java color 使用
import javax.inject.Named;@Namedpublic class MessageServerBean { public String getMessage() { return "Hello World!"; }}
Message is : #{messageServerBean.message}<br> Message Server Bean is : #{messageServerBean}
Message is : Hello World!Message Server Bean is : eedemo.MessageServerBean@xxxxxxx
@Named("itemProcessor")@RequestScoped //表示生命周期是request,每次request请求结束,生命就终止,也可以有Session或 Application等public class ItemProcessor { @Inject private ItemDao itemDao; //表示ItemDao需要被注入 ...}
public class PersonFactory { @Produces @RequestScoped public Person createPerson() { return new Person(); }}
public void observeUserEvent(@Observes User user) { ...}
@Named@SessionScopedpublic class HelloWorld extends GenericComposer implements Serializable { @Inject @ComponentId("guestName") Textbox guestName; @Inject @ComponentId("sayHelloBtn") Button sayHelloBtn; @Inject @ComponentId("helloWindow") Window helloWindow; public void sayHello(@Observes @Events("sayHelloBtn.onClick") MouseEvent evt) { helloWindow.setTitle("Hello " + guestName.getValue()); }}
转自:http://www.jdon.com/38322
CDI Event解析,布布扣,bubuko.com
CDI Event解析
原文地址:http://www.cnblogs.com/juepei/p/3857207.html