http://jakarta.apache.org/tomcat/tomcat-4.0-doc/realm-howto.html
http://jakarta.apache.org/tomcat/tomcat-3.3-doc/JDBCRealm-howto.html

解决方案 »

  1.   

    dmhorse(dmhorse) 老兄说的是tomcat的realm验证吧?
    我现在在登录动作loginAction中判断了session中用户的权限,唉,应该不是很好的办法,可惜实在找不到其他的,
    盼高人指点!
      

  2.   

    难道struts本身只是一个frame,验证需要服务器解决?
    比如用tomcat就用tomcat解决,用weblogic就用weblogic解决?
    继续求教
      

  3.   

    在Action中perform()中检测session是否过期...
      

  4.   

    exactly! Struts just a framework,the authenticationI think u should use a gobal filter to implement that,if u not want to use the tomcat tech
      

  5.   

    struts做验证的方法有许多种,
    1、J2EE的角色资源授权验证方法,主要是通过支持角色资源授权的服务器(如tomcat)实现,在web.xml中配置:
       <security-constraint>
      .................
       <security-constraint>
    在server.xml中配置验证数据源
    <realm  ...>2、自定义组件、自定义标签权验证方法
       建立一个自定义标签,在自定义标签中实现验证,方法是在自定义标签中编写判断代码,如果通过验证则继续,否则转发到验证页面。
        在所有需要验证的页面加入自定义标签,实现验证功能。3、在每个页面加上验证代码。
    方法1和2是较好的方法,方法1最方便,但与服务器有关;方法2灵活性最大,也算方便,但在多角色处理中,要自己编写代码。