JiveJdon Community Forums
在线101人   首页   主题表   培训咨询   标签   精华   查搜   注册    登陆 RSS
首页 » 论坛 » 开源JdonFramework及其应用案例论坛
???en_US.forumThreadPrev.name??? 上一主题
google yahoo 365Key网摘 CSDN网摘 添加到百度搜藏 POCO网摘 新浪ViVi 天极网摘
???en_US.forumThreadNext.name??? 下一主题
Go 共有 0 回复 / 1
 发表新帖子   回复该主题贴
banq

悄悄话
发表文章: 9613
注册时间: 2002年08月03日 17:08
基于Tomcat的容器认证配置 2007年08月13日 16:57 到本帖网址 加入本帖到收藏夹 回复该主题
标签
JiveJdon3需要容器认证,JiveJdon3安装说明是JBoss,今天搜索其他问题时发现是Tomcat的基于数据库Realm授权解决方案:

Eclisep 3 Tomcat 5.5 and Database Realm Authentication to work you need to:
1. Create your user table and role table in your prefered DB (MySQL in this case) with relevant username, password columns in the users table and username and rolename columns in your roles table
2. Create a context.xml file under META-INF in your Eclipse Web Project or similar (by the way use the context.xml for connection pool management too)
3. Copy the JDBC realm information from Tomcat server.xml (I'm using MySQL) into your context.xml file in Eclipse for example:
<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/secdb"
connectionName="apps" connectionPassword="guessme"
userTable="secuser" userNameCol="username" userCredCol="password"
userRoleTable="secrole" roleNameCol="role" />
这句关键
This is VITAL - I spent day's trawling the web trying to find this information
4. Update your web.xml file with the relevant security constraint, login-config and security role information for example:下面是标准写法
<security-constraint>
<web-resource-collection>
<web-resource-name>
QuoteTool
</web-resource-name>
<url-pattern>
/*.jsp
</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
<role-name>manager</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>
FORM
</auth-method>
<realm-name>QuoteTool</realm-name>
<form-login-config>
<form-login-page>/QuoteLogin.jsp</form-login-page>
<form-error-page>/LoginErr.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>admin</role-name>
</security-role>
<security-role>
<role-name>manager</role-name>
</security-role>

完整说明:

http://www.onjava.com/pub/a/onjava/2002/06/12/form.html
[该贴被banq于2007年08月13日 17:00修改过]
标签
共有 0 回复 / 1Go
???en_US.forumThreadPrev.name??? 上一主题
  Go back to the topic 返回本主题   Go back to the topic listing返回主题列表    返回页首返回页首
???en_US.forumThreadNext.name??? 下一主题
热点TAG:
正在读取,请等待...
查询本论坛内 回复超过的热门帖子
标题
 
粗体: [b]文本[/b] 斜体: [i]文本[/i] 下划线 [u]文本[/u] 插入图片 [img]http://wwww.xxxx.com/img.ext[/img] 插入代码 [code]程序代码[/code]  插入url链接 [url]http://url[/url] / [url=http://url]URL加下滑线[/url] 插入附件 插入word文档 Txt等文件
内容
  提交时自动拷贝以上内容到剪贴板 Ctrl-V可取出;提问题前先查询标签列表

RSS 手机阅读 add to google add to yahoo
解惑之道在J道 ,打造中国最具影响力的的企业软件社区 推荐Chrome快速浏览本站
OpenSource JIVEJDON v3.5 Powered by JdonFramework Code © 2002-09 jdon.com

anti spam