关于tomcat的认证功能问题 up有分 Jsp Web 编程指南里面好像有,我看过一个朋友遍过这个认证的东西。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <Context path="/OST" docBase="OST" debug="0" reloadable="true"><Realm className="org.apache.catalina.realm.JDBCRealm" debug="99" driverName="sun.jdbc.odbc.JdbcOdbcDriver" connectionURL="jdbc:odbc:OST" userTable="attraction" userNameCol="user_id" userCredCol="password" userRoleTable="user_role" roleNameCol="role_name" /></Context> 我也做过这方面的尝试,但是没有成功。我是这样做的:1。在tomcat下的conf下的tomcat-users.xml中配置一个user,如下:<user name="stone" password="stone" roles="registerd"/>2.配置web.xml在web-app标签里添加<login-config> <auth-method>BASIC</auth-method> <realm-name>Registered Users</realm-name></login-config>其它就有些不对了。你可以参考一下wrox(乐思)的《Professional Java Servlets2.3》. http://expert.csdn.net/Expert/TopicView3.asp?id=2611848 这是我以前做的1。在tomcat下的conf下的tomcat-users.xml中配置一个user,如下:<role rolename="airport"/><user username="airport" password="airport" roles="airport"/>2.配置web.xml在web-app标签里添加 <!-- Default login configuration uses form-based authentication --> <login-config> <auth-method>FORM</auth-method> <realm-name>Example Form-Based Authentication Area</realm-name> <form-login-config> <form-login-page>/jsp/login.jsp</form-login-page> <!---登陆画面 自己配---> <form-error-page>/jsp/error.jsp</form-error-page> <!---出错画面 自己配---> </form-login-config> </login-config> <!-- Security roles referenced by this web application --> <security-role> <role-name>airport</role-name> <!--- tomcat-users.xml的角色 --> </security-role> up,up,我也想知道那个高手能解决这个问题 在数据库中建立create table users ( user_name varchar(15) not null primary key, user_pass varchar(15) not null);create table user_roles ( user_name varchar(15) not null, role_name varchar(15) not null, primary key (user_name, role_name));具体看这个http://jakarta.apache.org/tomcat/tomcat-5.0-doc/realm-howto.html#JDBCRealm tomcat5.0.16自带的验证功能:Basic,Digest,Form,Client-Cert.Form? yu_shi_bin(想我的朋友) 介绍的已经很详细了,采用数据库验证效果不错 可能一些做过的朋友看到这里有些不耐烦了。可惜在下是一菜鸟,现在还有些云里雾里。看到各位朋友都有共同的愿望想弄明白这个问题。厚颜请yu_shi_bin兄把整个过程整理一下,贴在一个回帖里。我使用的是tomcat5.0.16。 那位高人帮忙翻译,或者提供中文译本。http://jakarta.apache.org/tomcat/tomcat-5.0-doc/realm-howto.html#JDBCRealm 这是翻译,揭帖哦;http://www.yesky.com/20020628/1618084_1.shtml 好了,问题基本解决了.谢谢yu_shi_bin的热心帮助,谢谢所有来此捧场的朋友.希望以后我们经常联系,共同进步. eclipse7 tomcat7 网页打不开 请大家介绍本Java Web的书籍来学习 好友的短消息 用hibernate怎么映射呢? jsp时间问题 谁能告诉我为什么错?急! 不会运行servlet,请问如何?? 分都没有了!这一次我是真的没辙了,人世间最奇怪的问题莫过于此,喜欢挑战的大虾请进来! 哪位仁兄知道有JSP+MYSQL空间出租,不要免费的。急!!! 笑着悲伤请进!!! JFinal 框架 路由问题 读取CLOB对象时的中文处理? netScape4.7如何实现防止连续点击同一个按钮?
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="sun.jdbc.odbc.JdbcOdbcDriver"
connectionURL="jdbc:odbc:OST"
userTable="attraction" userNameCol="user_id"
userCredCol="password" userRoleTable="user_role"
roleNameCol="role_name" />
</Context>
1。在tomcat下的conf下的tomcat-users.xml中配置一个user,如下:
<user name="stone" password="stone" roles="registerd"/>
2.配置web.xml
在web-app标签里添加
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>Registered Users</realm-name>
</login-config>
其它就有些不对了。
你可以参考一下wrox(乐思)的《Professional Java Servlets2.3》.
1。在tomcat下的conf下的tomcat-users.xml中配置一个user,如下:
<role rolename="airport"/>
<user username="airport" password="airport" roles="airport"/>2.配置web.xml
在web-app标签里添加
<!-- Default login configuration uses form-based authentication -->
<login-config>
<auth-method>FORM</auth-method>
<realm-name>Example Form-Based Authentication Area</realm-name>
<form-login-config>
<form-login-page>/jsp/login.jsp</form-login-page> <!---登陆画面 自己配---> <form-error-page>/jsp/error.jsp</form-error-page> <!---出错画面 自己配--->
</form-login-config>
</login-config>
<!-- Security roles referenced by this web application -->
<security-role>
<role-name>airport</role-name> <!--- tomcat-users.xml的角色 -->
</security-role>
create table users (
user_name varchar(15) not null primary key,
user_pass varchar(15) not null
);create table user_roles (
user_name varchar(15) not null,
role_name varchar(15) not null,
primary key (user_name, role_name)
);
具体看这个http://jakarta.apache.org/tomcat/tomcat-5.0-doc/realm-howto.html#JDBCRealm
Basic,Digest,Form,Client-Cert.
Form?
可惜在下是一菜鸟,现在还有些云里雾里。看到各位朋友都有共同的愿望想弄明白这个问题。
厚颜请yu_shi_bin兄把整个过程整理一下,贴在一个回帖里。
我使用的是tomcat5.0.16。
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/realm-howto.html#JDBCRealm
http://www.yesky.com/20020628/1618084_1.shtml
谢谢yu_shi_bin的热心帮助,谢谢所有来此捧场的朋友.
希望以后我们经常联系,共同进步.