|
Java学习者论壇
本人編写了一个利用weblogic中的安quan認证来控制用户访問的例子,修改了如下配置文件:
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>BasicAuthentication</display-name>
<description>Basic Authentication Sample for weblogic</description>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>myrealm</realm-name>
</login-config>
<security-role>
<role-name>webuser</role-name>
</security-role>
<security-constraint>
<web-resource-collection>
<web-resource-name>ResourceNameforAccess</web-resource-name>
<url-pattern>/index.jsp</url-pattern>
<http-method>GET</http-method>
<http-method>OST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>webuser</role-name>
</auth-constraint>
</security-constraint>
</web-app>
=============================================================================
weblogic.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
<weblogic-web-app>
<context-root>BasicAuthentication</context-root>
<security-role-assignment>
<role-name>webuser</role-name>
<principal-name>Administrators</principal-name>
<principal-name>MormalUser</principal-name>
</security-role-assignment>
</weblogic-web-app>
在Jbuilder X中编译时,报错如下:
"index.jsp": <2004-11-5 ????16 |
|