- 浏览: 101505 次
-
最新评论
-
jXee:
lgs0626 写道求源码,兄弟给共享下吧 "jee ...
jee6 学习笔记 4 - CRUD 2: View Details, Primefaces row selection -
lgs0626:
求源码,兄弟给共享下吧
jee6 学习笔记 4 - CRUD 2: View Details, Primefaces row selection
文章列表
JSF 2 provides copule of new scopes, among which the "Flash" scope is quite interesting. (i believe the concept is borrowed from other frameworks like the "Stripes" framework)
this is quoted from the Stripes framework documentation of its class net.sourceforge.str ...
JSF2 navigation can be done in couple of ways:
1. in the action bean, directly return page filename to "forward"(default) to, or "redirect"(need to define) to:
// a "forward"(default behavior) example.
public String yourActionMethod() {
// do your business
.. ...
A very good blog about learning JSF2.0:
http://mkblog.exadel.com/jsfrichfaces/learning-jsf-2/
JSF 2 has Ajax built in, lets take a look at how it works.
the tag (all attributes optional): <f:ajax event="keyup" render="ID to update, or EL" listener="#{bean.method}"/>
use case: user input a message, an output field renders the message vi ajax call to server ...
screenshot of view details button:
screenshot of view details of selected row:
updated backing bean "StudentSearch.java":
1. added property "Student selectedStudent"
2. added getter/setter for it, as selection action listener
package com.jxee.action.student;
import java. ...
实现简单的搜索功能:搜索学生姓名,同时利用primefaces datatable来显示结果。
screenshot: (Note, i've changed the theme from "sam" to "afterwork")
Backing bean StudentSearch:
package com.jxee.action.student;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import ja ...
简单看了一下,说是必须有一个配置文件beans.xml,但该文件可以是完全空白的。why?!
如果部署到.war而没有用到ejb,则可将该文件打包到WEB-INF。如果用到了ejb,则应该放到META-INF底下。
CD ...
这世间一切都是现成的。你到哪儿了,就得到你应得的,因此抱怨是愚蠢的。
明智的做法是行动,行到了,一切才真正到。
所以要做行动的巨人。
DAO interface.
package com.jxee.ejb;
import javax.ejb.Local;
import com.jxee.model.User;
/**
* although it's not required, it's good practice to define a DAO interface.
* annotation @Local marks this as an EJB local interface.
*/
@Local
public interface UserDAO {
public User find ...
-- find oracle version
SELECT * FROM SYS.product_component_version;
-- find table meta data: table name is in upper case
select * from all_tables WHERE TABLE_NAME = 'CUSTOMERS';
-- find constraint's attribute, like the table name it belongs to
select * from all_constraints WHERE CONSTRAINT_NAME = ' ...
cannot connect to oracle due to error "ORA-12541: TNS no listener".
casuse: most likely the Oracle listener is not started.
solution: you need to logon to the database server as oracle user or superuser and run this command: lsnrctl start
看看BackingBean(or ActionBean if you like),先上图。
the login screen
login validation 1: missing required fields
login validation 2: wrong password
home screen: after successful login
login.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/T ...
jee不停地折腾,好像09年推出了jee6,但我们还在用jee5。从jee5开始,jee将ejb技术进行了改良,增加了注入功能,减少配置文件,这是好事。在ejb3基础上,jee6进一步简化,推出了ejb3.1/jsf2.0
从编程的角度出发,jee6还是利用annotation ...