• 大小: 280KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-08
  • 语言: Java
  • 标签: seam  

资源简介

这个例子里面有注册,登陆,猜数字游戏(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  复件 seam813\.classpath

     文件       1252  2011-08-12 10:22  复件 seam813\.project

     文件        561  2011-08-12 10:29  复件 seam813\.settings\gen-entities.hibernate.reveng.xml

     文件         88  2011-08-12 16:06  复件 seam813\.settings\org.eclipse.core.resources.prefs

     文件        114  2011-08-12 09:52  复件 seam813\.settings\org.hibernate.eclipse.console.prefs

     文件        585  2011-08-12 10:22  复件 seam813\.settings\org.jboss.tools.seam.core.prefs

     文件        410  2011-08-12 09:52  复件 seam813\bootstrap\commons-logging.properties

     文件       9927  2011-08-12 09:52  复件 seam813\bootstrap\conf\bootstrap-beans.xml

     文件       6659  2011-08-12 09:52  复件 seam813\bootstrap\conf\jboss-service.xml

     文件       9294  2011-08-12 09:52  复件 seam813\bootstrap\conf\jbossjta-properties.xml

     文件       3287  2011-08-12 09:52  复件 seam813\bootstrap\conf\login-config.xml

     文件         39  2011-08-12 09:52  复件 seam813\bootstrap\conf\props\messaging-roles.properties

     文件         32  2011-08-12 09:52  复件 seam813\bootstrap\conf\props\messaging-users.properties

     文件      24004  2011-08-12 09:52  复件 seam813\bootstrap\deploy\ejb3-interceptors-aop.xml

     文件       4882  2011-08-12 09:52  复件 seam813\bootstrap\deploy\hsqldb-ds.xml

     文件       2402  2011-08-12 09:52  复件 seam813\bootstrap\deploy\jboss-local-jdbc.rar

     文件       2517  2011-08-12 09:52  复件 seam813\bootstrap\deploy\jboss-xa-jdbc.rar

     文件       1979  2011-08-12 09:52  复件 seam813\bootstrap\deploy\jms-ra.rar

     文件       6242  2011-08-12 09:52  复件 seam813\bootstrap\deploy\messaging\connection-factories-service.xml

     文件       1343  2011-08-12 09:52  复件 seam813\bootstrap\deploy\messaging\destinations-service.xml

     文件       4713  2011-08-12 09:52  复件 seam813\bootstrap\deploy\messaging\hsqldb-persistence-service.xml

     文件       1886  2011-08-12 09:52  复件 seam813\bootstrap\deploy\messaging\jms-ds.xml

     文件        482  2011-08-12 09:52  复件 seam813\bootstrap\deploy\messaging\legacy-service.xml

     文件       4920  2011-08-12 09:52  复件 seam813\bootstrap\deploy\messaging\messaging-service.xml

     文件       3507  2011-08-12 09:52  复件 seam813\bootstrap\deploy\messaging\remoting-service.xml

     文件        547  2011-08-12 09:52  复件 seam813\bootstrap\deploy\remoting-service.xml

     文件       2420  2011-08-12 09:52  复件 seam813\bootstrap\deployers\aspect-deployer-beans.xml

     文件       2543  2011-08-12 09:52  复件 seam813\bootstrap\deployers\ejb-deployer-beans.xml

     文件      11426  2011-08-12 09:52  复件 seam813\bootstrap\deployers\ejb3-deployers-beans.xml

     文件        830  2011-08-12 09:52  复件 seam813\bootstrap\deployers\jboss-aspect-library-beans.xml

............此处省略321个文件信息

评论

共有 条评论

相关资源