資源簡介
這個例子里面有注冊,登陸,猜數(shù)字游戲(jbpm)和sayHello例子。
jar太大,沒上傳

代碼片段和文件信息
package?com.future.seam813.action;
import?javax.persistence.EntityManager;
import?org.jboss.seam.annotations.In;
import?org.jboss.seam.annotations.Logger;
import?org.jboss.seam.annotations.Name;
import?org.jboss.seam.log.Log;
import?org.jboss.seam.security.Credentials;
import?org.jboss.seam.security.Identity;
import?com.future.seam813.entity.User;
@Name(“authenticator“)
public?class?Authenticator
{
????@Logger?private?Log?log;
????@In?Identity?identity;
???//?@In?Credentials?credentials;??
?????@In?private?User?user;
@In?EntityManager?entityManager;
????public?boolean?authenticate()
????{
????log.info(“user?name:“?user.getName());
//????????//write?your?authentication?logic?here
//????????//return?true?if?the?authentication?was
//????????//successful?false?otherwise
//????????if?(“admin“.equals(credentials.getUsername()))
//????????{
//????????????identity.addRole(“admin“);
//????????????return?true;
//????????}
//????????return?false;
???? ??try??
???? ????????{???
???? ?????????????user?=?(User)?entityManager.createQuery(???
???? ????????????“from?User?where?name?=?:username?and?password?=?:password“)???
???? ???????????//?.setParameter(“username“?Identity.instance().getUsername())???
???? ??????????//??.setParameter(“password“?Identity.instance().getPassword())???
???? ????????????.setParameter(“username“?user.getName())
???? ?????????????.setParameter(“password“?user.getPassword())
???? ????????????.getSingleResult();???
???? ????
???? ?????????????if?(user.getRole()?!=?null)???
???? ?????????????{???
???? ?????????????????Identity.instance().addRole(user.getRole());???
???? ?????????????}???
???? ????????????return?true;???
???? ??????????}???
???? ??????????catch?(Exception?ex)???
???? ?????????{???
???? ?????????????return?false;???
???? ?????????}???
???? ??????}???
????}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????2832??2011-08-12?09:52??復(fù)件?seam813\.classpath
?????文件???????1252??2011-08-12?10:22??復(fù)件?seam813\.project
?????文件????????561??2011-08-12?10:29??復(fù)件?seam813\.settings\gen-entities.hibernate.reveng.xm
?????文件?????????88??2011-08-12?16:06??復(fù)件?seam813\.settings\org.eclipse.core.resources.prefs
?????文件????????114??2011-08-12?09:52??復(fù)件?seam813\.settings\org.hibernate.eclipse.console.prefs
?????文件????????585??2011-08-12?10:22??復(fù)件?seam813\.settings\org.jboss.tools.seam.core.prefs
?????文件????????410??2011-08-12?09:52??復(fù)件?seam813\bootstrap\commons-logging.properties
?????文件???????9927??2011-08-12?09:52??復(fù)件?seam813\bootstrap\conf\bootstrap-beans.xm
?????文件???????6659??2011-08-12?09:52??復(fù)件?seam813\bootstrap\conf\jboss-service.xm
?????文件???????9294??2011-08-12?09:52??復(fù)件?seam813\bootstrap\conf\jbossjta-properties.xm
?????文件???????3287??2011-08-12?09:52??復(fù)件?seam813\bootstrap\conf\login-config.xm
?????文件?????????39??2011-08-12?09:52??復(fù)件?seam813\bootstrap\conf\props\messaging-roles.properties
?????文件?????????32??2011-08-12?09:52??復(fù)件?seam813\bootstrap\conf\props\messaging-users.properties
?????文件??????24004??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deploy\ejb3-interceptors-aop.xm
?????文件???????4882??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deploy\hsqldb-ds.xm
?????文件???????2402??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deploy\jboss-local-jdbc.rar
?????文件???????2517??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deploy\jboss-xa-jdbc.rar
?????文件???????1979??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deploy\jms-ra.rar
?????文件???????6242??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deploy\messaging\connection-factories-service.xm
?????文件???????1343??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deploy\messaging\destinations-service.xm
?????文件???????4713??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deploy\messaging\hsqldb-persistence-service.xm
?????文件???????1886??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deploy\messaging\jms-ds.xm
?????文件????????482??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deploy\messaging\legacy-service.xm
?????文件???????4920??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deploy\messaging\messaging-service.xm
?????文件???????3507??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deploy\messaging\remoting-service.xm
?????文件????????547??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deploy\remoting-service.xm
?????文件???????2420??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deployers\aspect-deployer-beans.xm
?????文件???????2543??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deployers\ejb-deployer-beans.xm
?????文件??????11426??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deployers\ejb3-deployers-beans.xm
?????文件????????830??2011-08-12?09:52??復(fù)件?seam813\bootstrap\deployers\jboss-aspect-library-beans.xm
............此處省略321個文件信息
評論
共有 條評論