users@glassfish.java.net

Re: realm security with the hello world duke program...

From: <glassfish_at_javadesktop.org>
Date: Sun, 18 May 2008 14:50:13 PDT

you are a prince, thank you sooo much...
i apologize for the noobness of my question..
http://www.developinjava.com/readarticle.php?article_id=5

web.xml is
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
     <login-config>
          <auth-method>BASIC</auth-method>
          <realm-name>BroodWeb</realm-name>
     </login-config>
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Secure Pages</web-resource-name>
            <url-pattern>/*</url-pattern>
            <http-method>GET</http-method>
            <http-method>POST</http-method>
        </web-resource-collection>
        <auth-constraint>
            <role-name>USERS</role-name>
        </auth-constraint>
    </security-constraint>
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <servlet>
        <servlet-name>member.MemberServlet</servlet-name>
        <servlet-class>member.MemberServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>member.MemberServlet</servlet-name>
        <url-pattern>/member/servlet.jsp</url-pattern>
    </servlet-mapping>
</web-app>


sun-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
  <context-root>/BroodWeb</context-root>
  <class-loader delegate="true"/>
  <jsp-config>
    <property name="keepgenerated" value="true">
      <description>Keep a copy of the generated servlet class' java code.</description>
    </property>
  </jsp-config>
    <security-role-mapping>
          <role-name>USERS</role-name>
          <group-name>Users</group-name>
     </security-role-mapping>
</sun-web-app>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app error-url="">
  <context-root>/BroodWeb</context-root>
  <class-loader delegate="true"/>
  <jsp-config>
    <property name="keepgenerated" value="true">
      <description>Keep a copy of the generated servlet class' java code.</description>
    </property>
  </jsp-config>
</sun-web-app>

thanks again
[Message sent by forum member 'huggy77' (huggy77)]

http://forums.java.net/jive/thread.jspa?messageID=275079