alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

jforum example source code file (web.xml)

This example jforum source code file (web.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - jforum tags/keywords

admin, authenticated, container-managed, enable, for, me, me, remove, remove, ssl, this, this, to, to

The jforum web.xml source code

<?xml version="1.0" encoding="ISO-8859-1"?>

<!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>JSPWiki
   <description>
       JSPWiki is a free JSP-based WikiClone.  It is licenced
       under the Lesser GNU General Public License.

       JSPWiki is maintained by Janne Jalkanen (+others),
       jalkanen+jspwiki@ecyrd.com
   </description>

   <!--
      This is new in 2.4.  This defines a servlet filter which filters all requests. 
   -->

   <filter>
      <filter-name>WikiServletFilter
      <filter-class>com.ecyrd.jspwiki.ui.WikiServletFilter
   </filter>
   <filter>
      <filter-name>WikiJSPFilter
      <filter-class>com.ecyrd.jspwiki.ui.WikiJSPFilter
   </filter>

   <filter-mapping>
       <filter-name>WikiServletFilter
       <url-pattern>/attach/*
   </filter-mapping>
   <filter-mapping>
       <filter-name>WikiServletFilter
       <url-pattern>/atom/*
   </filter-mapping>
   <filter-mapping>
       <filter-name>WikiServletFilter
       <url-pattern>/dav/*
   </filter-mapping>
   <filter-mapping>
       <filter-name>WikiServletFilter
       <url-pattern>/RPCU/
   </filter-mapping>
   <filter-mapping>
       <filter-name>WikiServletFilter
       <url-pattern>/RPC2/
   </filter-mapping>
   <filter-mapping>
       <filter-name>WikiJSPFilter
       <url-pattern>/doc/*
   </filter-mapping>
   <filter-mapping>
       <filter-name>WikiJSPFilter
       <url-pattern>*.jsp
   </filter-mapping>

   <!--
       Now, let's define the XML-RPC interfaces.  You probably don't have to
       touch these.

       First, we'll define the standard XML-RPC interface.
     -->
   <servlet>
       <servlet-name>XMLRPC
       <servlet-class>com.ecyrd.jspwiki.xmlrpc.RPCServlet       
       <init-param>
           <param-name>handler
           <param-value>com.ecyrd.jspwiki.xmlrpc.RPCHandler
       </init-param>

       <init-param>
           <param-name>prefix
           <param-value>wiki
       </init-param>
   </servlet>

   <!--
       OK, this then defines that our UTF-8 -capable server.
     -->

   <servlet>
       <servlet-name>XMLRPC-UTF8
       <servlet-class>com.ecyrd.jspwiki.xmlrpc.RPCServlet       
       <init-param>
           <param-name>handler
           <param-value>com.ecyrd.jspwiki.xmlrpc.RPCHandlerUTF8
       </init-param>

       <init-param>
           <param-name>prefix
           <param-value>wiki
       </init-param>
   </servlet>

   <servlet>
       <servlet-name>ATOM
       <servlet-class>com.ecyrd.jspwiki.atom.AtomAPIServlet       
   </servlet>

   <!-- Maps short URLS to JSPs; also, detects webapp shutdown. -->
   <servlet>
       <servlet-name>WikiServlet
       <servlet-class>com.ecyrd.jspwiki.WikiServlet       
       <load-on-startup>1
   </servlet>

   <servlet>
       <servlet-name>DAVServlet
       <servlet-class>com.ecyrd.jspwiki.dav.WikiDavServlet
   </servlet>

   <!--
       Attachment exchange handler.
     -->

   <servlet>
       <servlet-name>AttachmentServlet
       <servlet-class>com.ecyrd.jspwiki.attachment.AttachmentServlet
   </servlet>

   <!-- PLACEHOLDER FOR PRE-COMPILED JSP SERVLETS -->

   <!--
       And finally, let us tell the servlet container which
       URLs should correspond to which XML RPC servlet.
     -->

   <!-- By default, this is disabled.  If you want to enabled it,
        just uncomment the whole section. -->

   <!--  REMOVE ME TO ENABLE XML-RPC

   <servlet-mapping>
       <servlet-name>XMLRPC
       <url-pattern>/RPC2/
   </servlet-mapping>

   <servlet-mapping>
       <servlet-name>XMLRPC-UTF8
       <url-pattern>/RPCU/
   </servlet-mapping>

   <servlet-mapping>
       <servlet-name>ATOM
       <url-pattern>/atom/*
   </servlet-mapping>

   AND REMOVE ME TOO -->

   <servlet-mapping>
       <servlet-name>AttachmentServlet
       <url-pattern>/attach/*
   </servlet-mapping>

   <servlet-mapping>
       <servlet-name>WikiServlet
       <url-pattern>/doc/*
   </servlet-mapping>

   <!-- Remove to enable WebDav. EXPERIMENTAL FEATURE!
   <servlet-mapping>
       <servlet-name>DAVServlet
       <url-pattern>/dav/*
   </servlet-mapping>
   -->

   <!-- This means that we don't have to use redirection
        from index.html anymore.  Yay! -->
   <welcome-file-list>
       <welcome-file>index.jsp
   </welcome-file-list>
   
   <!-- Error pages -->
   <error-page>
     <error-code>403
     <location>/error/Forbidden.html
   </error-page>

   <!--  REMOVE ME TO ENABLE JDBC DATABASE
   <resource-ref>
       <description>
           Resource reference to JNDI factory for the JDBCUserDatabase.
       </description>
       <res-ref-name>
           jdbc/UserDatabase
       </res-ref-name>
       <res-type>
           javax.sql.DataSource
       </res-type>
       <res-auth>
           Container
       </res-auth>
   </resource-ref>
   <resource-ref>
       <description>
           Resource reference to JNDI factory for the JDBCGroupDatabase.
       </description>
       <res-ref-name>
           jdbc/GroupDatabase
       </res-ref-name>
       <res-type>
           javax.sql.DataSource
       </res-type>
       <res-auth>
           Container
       </res-auth>
   </resource-ref>
   REMOVE ME TO ENABLE JDBC DATABASE  -->

   <!--
       CONTAINER-MANAGED AUTHENTICATION & AUTHORIZATION
    
       Here we define the users which are allowed to access JSPWiki.
       These restrictions cause the web container to apply further 
       contraints to the default security policy in jspwiki.policy,
       and should be suitable for a corporate intranet or public wiki.

       In particular, the restrictions below allow all users to
       read documents, but only Authenticated users can comment
       on or edit them (i.e., access the Edit.jsp page).
       Users with the role Admin are the only persons who can 
       delete pages. 

       To implement this policy, the container enforces two web
       resource constraints: one for the Administrator resources,
       and one for  Authenticated users. Note that the "role-name" 
       values are significant and should match the role names 
       retrieved by your web container's security realm. The roles 
       of "Admin" and "Authenticated" are assigned by the web 
       container at login time.

       For example, if you are using Tomcat's built-in "memory realm",
       you should edit the $CATALINA_HOME/conf/tomcat-users.xml file 
       and add the desired actual user accounts. Each user must possess
       one or both of the Admin or Authenticated roles. For other realm
       types, consult your web container's documentation.
       
       Alternatively, you could also replace all references to 
       "Authenticated" and "Admin" with role names that match those 
       returned by your container's security realm. We don't care
       either way, as long as they match.
       
       Note that accessing protected resources will cause your
       container to try to use SSL to secure the web session.
       This, of course, assumes your web container (or web server) 
       is configured with SSL support. If you do not wish to use SSL,
       remove the "user-data-constraint" elements.
   -->

   <!--  REMOVE ME TO ENABLE CONTAINER-MANAGED AUTH
   
   <security-constraint>
       <web-resource-collection>
           <web-resource-name>Administrative Area
           <url-pattern>/Delete.jsp
       </web-resource-collection>
       <auth-constraint>
           <role-name>Admin
       </auth-constraint>
       <user-data-constraint>
           <transport-guarantee>CONFIDENTIAL
       </user-data-constraint>
   </security-constraint>
      
   <security-constraint>
       <web-resource-collection>
           <web-resource-name>Authenticated area
           <url-pattern>/Edit.jsp
           <url-pattern>/Comment.jsp
           <url-pattern>/Login.jsp
           <url-pattern>/NewGroup.jsp
           <url-pattern>/Rename.jsp
           <url-pattern>/Upload.jsp
           <http-method>DELETE
           <http-method>GET
           <http-method>HEAD
           <http-method>POST
           <http-method>PUT
       </web-resource-collection>

       <web-resource-collection>
           <web-resource-name>Read-only Area
           <url-pattern>/attach
           <http-method>DELETE
           <http-method>POST
           <http-method>PUT
       </web-resource-collection>

       <auth-constraint>
           <role-name>Admin
           <role-name>Authenticated
       </auth-constraint>

       <user-data-constraint>
           <transport-guarantee>CONFIDENTIAL
       </user-data-constraint>
   </security-constraint>

   <login-config>
       <auth-method>FORM
       <form-login-config>
           <form-login-page>/LoginForm.jsp
           <form-error-page>/LoginForm.jsp
       </form-login-config>
   </login-config>

   <security-role>
       <description>
           This logical role includes all authenticated users
       </description>
       <role-name>Authenticated
   </security-role>

   <security-role>
       <description>
           This logical role includes all administrative users
       </description>
       <role-name>Admin
   </security-role>
   
   REMOVE ME TO ENABLE CONTAINER-MANAGED AUTH  -->
 
</web-app>

Other jforum examples (source code examples)

Here is a short list of links related to this jforum web.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.