Filter - web.xml

Hi,
I have written and deployed a security filter.
Would like to know how to configure a Filter(security filter) in any/my web application.
The link below mentions this is possible. Pl give me more details.
http://help.sap.com/saphelp_nw04/helpdata/en/53/7be8dca2241d42a43fd4ae268f1fd8/frameset.htm
Regards

Hi Sudhish,
FYI
System parameter rsau/selection_slots can be used to set maximum number of fillters. The maximum value of this till 4.6  was 5. Think this has moved to 10 now.
Check the following links for info on filters
http://help.sap.com/saphelp_nwmobile71/helpdata/en/b6/d6af856bc011d1a56c0000e835363f/content.htm
and
http://help.sap.com/saphelp_nwmobile71/helpdata/en/f8/5a21b80f2d11d2a5ba0000e835363f/content.htm
I hope this helps
Regards
Chen

Similar Messages

  • URLs not matching the mappings I set in web.xml

    Below is what I observe, I would have expected the URL to match all 3 but it only matches for the first one , any ideas?
    Web.xml contains
    <filter>
         <filter-name>MyFilter</filter-name>
         <filter-class>HWfilter</filter-class>
    </filter>
    <filter-mapping>
         <filter-name>MyFilter</filter-name>
         <url-pattern>/*</url-pattern>
    </filter-mapping>
    http://localhost/Chapter7/test.txt  - URL matches filter
    Web.xml contains
    <filter>
         <filter-name>MyFilter</filter-name>
         <filter-class>HWfilter</filter-class>
    </filter>
    <filter-mapping>
         <filter-name>MyFilter</filter-name>
         <url-pattern>*</url-pattern>
    </filter-mapping>
    http://localhost/Chapter7/test.txt  - URL DOES NOT match filter
    Web.xml contains
    <filter>
         <filter-name>MyFilter</filter-name>
         <filter-class>HWfilter</filter-class>
    </filter>
    <filter-mapping>
         <filter-name>MyFilter</filter-name>
         <url-pattern>/*.txt</url-pattern>
    </filter-mapping>
    http://localhost/Chapter7/test.txt  - URL DOES NOT match filter
    ----------------------------------------------------------------

    I found this in the Servlet API specification:
    � A string beginning with a �/� character and ending with a �/*� postfix is used
    for path mapping.
    � A string beginning with a �*.� prefix is used as an extension mapping.
    � A string containing only the �/� character indicates the "default" servlet of the
    application. In this case the servlet path is the request URI minus the context
    path and the path info is null.
    � All other strings are used for exact matches only.
    According to this, your third one should work if you remove the / and just have *.txt.

  • Is it possible to add a filter to a webapp without declaring it in web.xml

    Hello,
    I'd like to add a filter in my web.xml file, but without declaring it in my webapp.
    Indeed, I have multiple webapps, and I'd like to have a common web.xml file that should be directly included in all the webapps including this package ?
    Is it possible or not ?
    As for JSF, it is possible to add faces-config file by putting it in the META-INF of the package.
    Thanks in advance.
    bgOnline

    Your title and your question are opposites...
    A filter must be specified in a web.xml to be used. That doesn't mean the Filter's class HAS to be in your webapp, it just must be accessible to the Servlet container (you could place it in the common/classes directory or shared/classes directory or even the server/classes directory).
    I've not tried it, but I see no reason why you couldn't declare the filter and filter-mapping in the server's web.xml which would then filter all requests in all webapps.
    HTH.

  • Agent filter location in web.xml for websphere v7.0

    In the document:
    Sun OpenSSO Enterprise Policy Agent 3.0 Guide for IBM WebSphere Application Server 6.1/7.0 and WebSphere Portal Server 6.1
    I'm and tying to do this part:
    Installing the Agent Filter for the WebSphere Application Server 6.1/7.0 Administration Console
    for my WebSphere 7.0 installation.
    My issue is the placement of the second filter.
    <filter-mapping>
    <filter-name>Agent</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    the doc says to put it under:
    <filter-mapping>
    <filter-name>WSCUrlFilter</filter-name>
    <servlet-name>action</servlet-name>
    </filter-mapping>
    <filter-mapping>
         <filter-name>WSCUrlFilter</filter-name>
    <url-pattern>/federatedlogoff</url-pattern>
    </filter-mapping>
    however, my Websphere 7.0 web.xml does not have this section in the file.
    Can some one assist me with proper placement?
    here is the first few lines of my xml:
    <?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="WebApp_1" version="2.4" xsi:schemaLocation="http://java.sun.co
    m/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>isclite</display-name>
    <filter>
    <filter-name>WSCUrlFilter</filter-name>
    <filter-class>com.ibm.ws.console.core.servlet.WSCUrlFilter</filter-class>
    </filter>
    <filter>
    <filter-name>Trace_Tree_Cache_Init_Filter</filter-name>
    <filter-class>com.ibm.ws.console.probdetermination.trace.tree.TraceTreeCacheInit</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>WSCUrlFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>Trace_Tree_Cache_Init_Filter</filter-name>
    <servlet-name>Trace Tree Servlet</servlet-name>
    </filter-mapping>
    <listener>
    <listener-class>com.ibm.isclite.SessionListener</listener-class>
    </listener>
    <listener>
    <listener-class>com.ibm.ws.console.appmanagement.SessionListener</listener-class>
    </listener>
    <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/config/struts-config.xml</param-value>
    </init-param>
    </servlet>
    <servlet>
    <servlet-name>SecureCleanup</servlet-name>
    <servlet-class>com.ibm.ws.console.core.servlet.SecureCleanupServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>FederationServlet</servlet-name>
    <servlet-class>com.ibm.ws.console.core.servlet.FederationServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>ProfileSelectionServlet</servlet-name>
    <servlet-class>com.ibm.ws.console.core.servlet.ProfileSelectionServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>ConsoleCSS</servlet-name>
    <jsp-file>secure/layouts/console_css.jsp</jsp-file>
    </servlet>
    <servlet>
    <servlet-name>EventInitializer</servlet-name>
    <servlet-class>com.ibm.ws.console.events.EventListenerServlet</servlet-class>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>downloadFile</servlet-name>
    <servlet-class>com.ibm.ws.console.core.servlet.DownloadFileServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>StatusServlet</servlet-name>
    <servlet-class>com.ibm.ws.console.core.servlet.StatusServlet</servlet-class>
    </servlet>
    <servlet>

    See below. You just have additional probe filters.
    862059 wrote:
    In the document:
    Sun OpenSSO Enterprise Policy Agent 3.0 Guide for IBM WebSphere Application Server 6.1/7.0 and WebSphere Portal Server 6.1
    I'm and tying to do this part:
    Installing the Agent Filter for the WebSphere Application Server 6.1/7.0 Administration Console
    for my WebSphere 7.0 installation.
    My issue is the placement of the second filter.
    <filter-mapping>
    <filter-name>Agent</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    the doc says to put it under:
    <filter-mapping>
    <filter-name>WSCUrlFilter</filter-name>
    <servlet-name>action</servlet-name>
    </filter-mapping>
    <filter-mapping>
         <filter-name>WSCUrlFilter</filter-name>
    <url-pattern>/federatedlogoff</url-pattern>
    </filter-mapping>
    however, my Websphere 7.0 web.xml does not have this section in the file.
    Can some one assist me with proper placement?
    here is the first few lines of my xml:
    <?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="WebApp_1" version="2.4" xsi:schemaLocation="http://java.sun.co
    m/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>isclite</display-name>
    <filter>
    <filter-name>WSCUrlFilter</filter-name>
    <filter-class>com.ibm.ws.console.core.servlet.WSCUrlFilter</filter-class>
    </filter>
    <filter>
    <filter-name>Trace_Tree_Cache_Init_Filter</filter-name>
    <filter-class>com.ibm.ws.console.probdetermination.trace.tree.TraceTreeCacheInit</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>WSCUrlFilter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>Trace_Tree_Cache_Init_Filter</filter-name>
    <servlet-name>Trace Tree Servlet</servlet-name>
    </filter-mapping><filter-mapping>
    <filter-name>Agent</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    <listener>
    <listener-class>com.ibm.isclite.SessionListener</listener-class>
    </listener>
    <listener>
    <listener-class>com.ibm.ws.console.appmanagement.SessionListener</listener-class>
    </listener>
    <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/config/struts-config.xml</param-value>
    </init-param>
    </servlet>
    <servlet>
    <servlet-name>SecureCleanup</servlet-name>
    <servlet-class>com.ibm.ws.console.core.servlet.SecureCleanupServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>FederationServlet</servlet-name>
    <servlet-class>com.ibm.ws.console.core.servlet.FederationServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>ProfileSelectionServlet</servlet-name>
    <servlet-class>com.ibm.ws.console.core.servlet.ProfileSelectionServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>ConsoleCSS</servlet-name>
    <jsp-file>secure/layouts/console_css.jsp</jsp-file>
    </servlet>
    <servlet>
    <servlet-name>EventInitializer</servlet-name>
    <servlet-class>com.ibm.ws.console.events.EventListenerServlet</servlet-class>
    <load-on-startup>2</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>downloadFile</servlet-name>
    <servlet-class>com.ibm.ws.console.core.servlet.DownloadFileServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>StatusServlet</servlet-name>
    <servlet-class>com.ibm.ws.console.core.servlet.StatusServlet</servlet-class>
    </servlet>
    <servlet>

  • FORMAUTH Filter in orion-web.xml ignored

    I am trying to use a JAAS Custom Login Module with a customized logon.jsp (and Struts). So I defined a FORMAUTH Filter in orion-web.xml to intercept the logon.
    However, Oracle 10g 10.1.3.2 did not deploy it. Why? How can I fix this problem?
    ===========================================================
    Deployed Application:
    {ORACLE_10_1_3_2_HOME}\j2ee\home\application-deployments\{APPLICATION}\{APPLICATION_WAR}\orion-web.xml contained:
    <?xml version="1.0"?>
    <orion-web-app
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-web-10_0.xsd"
         deployment-version="10.1.3.1.0"
         deployment-time="1189531757046"
         development="true"
         jsp-cache-directory="./persistence"
         jsp-cache-tlds="standard"
         simple-jsp-mapping="false"
         temporary-directory="./temp"
         servlet-webdir="/servlet"
         context-root="visit"
    schema-major-version="10" schema-minor-version="0" >
         <web-app-class-loader search-local-classes-first="true" include-war-manifest-class-path="true" />
         <web-app>
         </web-app>
    </orion-web-app>
    ===========================================================
    BUT: APPLICATION.EAR structure:
    APPLICATION_WAR\WEB-INF\orion-web.xml contained:
    <?xml version="1.0"?>
    <!DOCTYPE orion-web-app PUBLIC "-//ORACLE//DTD OC4J Web Application 9.04//EN" "http://xmlns.oracle.com/ias/dtds/orion-web-9_04.dtd">
    <orion-web-app
         deployment-version="10.1.3.1.0"
         temporary-directory="./temp"
         internationalize-resources="false"
         default-mime-type="application/octet-stream"
         jsp-cache-directory="./persistence"
         servlet-webdir="/servlet"
         development="true">
              <web-app-class-loader search-local-classes-first="true" include-war-manifest-class-path="true" />
    <web-app>
    <filter>
    <filter-name>AuthenicationFilter</filter-name>
    <filter-class>gov.dhs.visit.filter.AuthenicationFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>AuthenicationFilter</filter-name>
    <dispatcher>FORMAUTH</dispatcher>
    <url-pattern>*.do</url-pattern>
    </filter-mapping>
    </web-app>
    </orion-web-app>

    I've used this before, and it worked fine. The only difference I can see is that you have a url-pattern element in the filter-mapping config.
    In the short term, try removing that and see if it then works.
    -steve-

  • Implication of not adding amagent filter to web.xml of protected applicatio

    Hi, i have installed an J2EE agent to protect my application. The filtering mode is J2EE_ONLY and web tier declarative security is used. The agent is protecting my application without the am agent filter added to the web.xml of the application. Is adding of the filter required? What feature will be missing if the filter is not added?
    Thanks,

    Hi,
    Yes, you need to add the filter element to reference the opensso/am agent. This is the mechanism that is used so that the agent can intercept all the we requests and let the agent check do security checks etc.
    hth,
    Sean

  • Servlet Filters not following filter mapping in web.xml

    Hi Experts,
    I have two Servlet filters SetCharacterEncodingFilter and LASBackOfficeAuthFilter which are mapped in such a way that SetCharacterEncodingFilter gets called before LASBackOfficeAuthFilter(This is done in web.xml using filter mapping).
    I have code in SetCharacterEncodingFilter init() method to read and store the few parameters from a table , it also creates a new thread to montior db changes in these paremeters . LASBackOfficeAuthFilter reads a those parameters set after SetCharacterEncodingFilter initialization. This is failing in Weblogic Version: 10.3.2.0 because the LASBackOfficeAuthFilter init method gets called before SetCharacterEncodingFilter init method.
    This is filter mapping order is working fine In Web Sphere and Tomcat 6 .
    The web.xml filter mapping is given below .
         <filter>
              <filter-name>LASBackOfficeAuthFilter</filter-name>
              <display-name>Scheduler Authentication Filter</display-name>
              <filter-class>com.scheduler.servlet.backoffice.LASBackOfficeAuthFilter</filter-class>
              <!-- parameters specifying BackOffice servlet path translation -->
              <init-param>
                   <param-name>PathLogin</param-name>
                   <param-value>/login</param-value>
              </init-param>
              <init-param>
                   <param-name>PathLogout</param-name>
                   <param-value>/logout</param-value>
              </init-param>
              <init-param>
                   <param-name>PathNotifications</param-name>
                   <param-value>/secure/notifications</param-value>
              </init-param>
              <init-param>
                   <param-name>PathSchedulerActions</param-name>
                   <param-value>/secure/schedactions</param-value>
              </init-param>
              <init-param>
                   <param-name>PathPing</param-name>
                   <param-value>/secure/ping</param-value>
              </init-param>
         </filter>
         <!--
              this filter sets character encoding and mimetype for requests and
              responses
         -->
         <filter>
              <filter-name>SetCharacterEncodingFilter</filter-name>
              <display-name>Scheduler Character Encoding Filter</display-name>
              <filter-class>com.scheduler.servlet.backoffice.SetCharacterEncodingFilter</filter-class>
         </filter>
         <!-- correlate servlets and filters -->
         <filter-mapping>
              <filter-name>SetCharacterEncodingFilter</filter-name>
              <servlet-name>LASBackOfficeServlet</servlet-name>
         </filter-mapping>
         <filter-mapping>
              <filter-name>LASBackOfficeAuthFilter</filter-name>
              <servlet-name>LASBackOfficeServlet</servlet-name>
         </filter-mapping>
    Any help on this would be very much appreciated .
    Regards
    Dinesh

    No, regular expressions are not supported. You can specify the mapping with extensions, or with paths, not at the same time in the same mapping specification. However, you can specify two servlet mappings, one with extension, and one with path.
    The exact wording from the spec (2.4) is as follows:
    In the Web application deployment descriptor, the following syntax is used to define
    mappings:
    • A string beginning with a ‘/’ character and ending with a ‘/*’ suffix is used
    for path mapping.
    • A string beginning with a ‘*.’ prefix is used as an extension mapping.
    • A string containing only the ’/’ character indicates the "default" servlet of
    the application. In this case the servlet path is the request URI minus the context
    path and the path info is null.
    • All other strings are used for exact matches only.

  • Regular Expression Filter Mapping In Web.xml

    I have a situation where I need to filter URL's that don't have a file extension. There are hundreds of URL's, so i can't specify each one separately.
    From what I understand, you can have a filter mapping in web.xml to map certain file extensions to a filter, such as :
    <filter>
    <filter-name>MyFilter</filter-name>
    <filter-class>com.filters.MyFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>MyFilter</filter-name>
    <url-pattern>*.esi</url-pattern>
    </filter-mapping>
    ...where all files of extension .esi go through the filter. Additionally, I want to map all url's WITHOUT a file extension to pass through this filter. So if I have a request for "http://myserver.com/home" it will pass through the filter.
    Does weblogic support regular expressions for pattern matching in filter-mapping? If so, can you provide examples or links to documentation?
    Thanks,
    Jim

    No, regular expressions are not supported. You can specify the mapping with extensions, or with paths, not at the same time in the same mapping specification. However, you can specify two servlet mappings, one with extension, and one with path.
    The exact wording from the spec (2.4) is as follows:
    In the Web application deployment descriptor, the following syntax is used to define
    mappings:
    • A string beginning with a ‘/’ character and ending with a ‘/*’ suffix is used
    for path mapping.
    • A string beginning with a ‘*.’ prefix is used as an extension mapping.
    • A string containing only the ’/’ character indicates the "default" servlet of
    the application. In this case the servlet path is the request URI minus the context
    path and the path info is null.
    • All other strings are used for exact matches only.

  • What is Wrong with my filter and filter-mapping in web.xml?

    First, thanks all for your attention.
    I have checked the place where I should place <filter> and <filter-mapping> in web.xm. They should be after the <display-name>, before <servlet> and <servlet-mapping>.
    However, as soon as I insert the <filter> and <filter-mapping> elements in my web.xml, all my struts-bean.tld, struts-html.tld, etc. in the web.xml cannot be found at the runtime.
    Please help in identifying the problem. Thank you.
      <filter>
       <filter-name>trailFilter</filter-name>
       <filter-class>org.osjava.taglib.trail.OriginalRequestFilter</filter-class>
      </filter>
      <filter-mapping>
       <filter-name>trailFilter</filter-name>
       <url-pattern>*.do</url-pattern>
      </filter-mapping>and my web-xml is:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
      "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
      <display-name>Struts Example Application</display-name>
      <!-- Action Servlet Configuration -->
      <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
          <param-name>config</param-name>
          <param-value>/WEB-INF/struts-config.xml, /WEB-INF/struts-config-registration.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <!-- Action Servlet Mapping -->
      <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
      </servlet-mapping>
      <!-- The Welcome File List -->
      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
      <!-- The default error page -->
      <error-page>
       <exception-type>java.lang.Exception</exception-type>
       <location>\Error.jsp</location>
      </error-page>
      <!-- Application Tag Library Descriptor -->
      <taglib>
        <taglib-uri>/tags/app</taglib-uri>
        <taglib-location>/WEB-INF/app.tld</taglib-location>
      </taglib>
      <!-- Struts Tag Library Descriptors -->
      <taglib>
        <taglib-uri>/tags/struts-bean</taglib-uri>
        <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-html</taglib-uri>
        <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-logic</taglib-uri>
        <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-nested</taglib-uri>
        <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
      </taglib>
    </web-app>

    Filters were introduced in the servlet 2.3 specification (j2ee 1.3) - http://java.sun.com/products/servlet/Filters.html.
    Your web.xml constraints your web application to adhere to 2.2 standards (according to your DOCTYPE definition in your web.xml). Change it to conform to 2.3 standards
    <!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>
            //your definitions
    </web-app>Note : Your container should support the 2.3 spec (Tomcat 4.0 and above does, I guess)
    ram.

  • What is Wrong with filter and filter-mapping in My web.xml?

    First, thanks all for your attention.
    I have checked the place where I should place <filter> and <filter-mapping> in web.xm. They should be after the <display-name>, before <servlet> and <servlet-mapping>.
    However, as soon as I insert the <filter> and <filter-mapping> elements in my web.xml, all my struts-bean.tld, struts-html.tld, etc. in the web.xml cannot be found at the runtime.
    Please help in identifying the problem. Thank you.
      <filter>
       <filter-name>trailFilter</filter-name>
       <filter-class>org.osjava.taglib.trail.OriginalRequestFilter</filter-class>
      </filter>
      <filter-mapping>
       <filter-name>trailFilter</filter-name>
       <url-pattern>*.do</url-pattern>
      </filter-mapping>and my web-xml is:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
      PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
      "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
    <web-app>
      <display-name>Struts Example Application</display-name>
      <!-- Action Servlet Configuration -->
      <servlet>
        <servlet-name>action</servlet-name>
        <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
        <init-param>
          <param-name>config</param-name>
          <param-value>/WEB-INF/struts-config.xml, /WEB-INF/struts-config-registration.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <!-- Action Servlet Mapping -->
      <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
      </servlet-mapping>
      <!-- The Welcome File List -->
      <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
      <!-- The default error page -->
      <error-page>
       <exception-type>java.lang.Exception</exception-type>
       <location>\Error.jsp</location>
      </error-page>
      <!-- Application Tag Library Descriptor -->
      <taglib>
        <taglib-uri>/tags/app</taglib-uri>
        <taglib-location>/WEB-INF/app.tld</taglib-location>
      </taglib>
      <!-- Struts Tag Library Descriptors -->
      <taglib>
        <taglib-uri>/tags/struts-bean</taglib-uri>
        <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-html</taglib-uri>
        <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-logic</taglib-uri>
        <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
      </taglib>
      <taglib>
        <taglib-uri>/tags/struts-nested</taglib-uri>
        <taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
      </taglib>
    </web-app>

    Multiple Post - http://forum.java.sun.com/thread.jspa?threadID=734506

  • Is there any way to prevent web.xml from any change ?

    hi all,
    we have a filter in web.xml. Now we want to prevent it from any change in future. I mean after making a war(EAR) no one can change the filter in web.xml. if he chaged it then he will not be able to re deploy the application.Right now it is in web.xml so one can easily change it and then he can redeploy the application.
    Is there any way to prevent web.xml from any change after making EAR(WAR)?
    One can easily make a change in web.xml and redeploy the application to get the result. Now we want to restrict the web.xml as java class for any change after making EAR(or WAR).
    Could some one help me to do this?
    thanks,
    dinesh

    I think you could use some third party software to lock the folder like FolderLock, just make sure others ppl cannot access your file should be fined.
    This is my stupid solution only,cheers.

  • Problem in web.xml file with weblogic server 8.1

    Hi frnds,
    I was deployed one Enterprise Application,it deploys successfully. But in server side thows Exeception in web.xml file.
    Here the actual Exception
    <HTTP> <BEA-101248> <[Application:
    'G:\bea\user_projects\domains\mydomain\myserver\upload\jasmine.ear', Module: 'Ja
    smine']: Deployment descriptor "web.xml" is malformed. Check against the DTD: or
    g.xml.sax.SAXParseException: The content of element type "web-app" must match "(
    icon?,display-name?,description?,distributable?,context-param*,filter*,filter-ma
    pping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome
    -file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constra
    int*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)". (line 61
    , column 11).>
    My web.xml file as follws....
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.4//EN"
    "http://java.sun.com/dtd/web-app_2_4.dtd">
    <web-app>
    <display-name>Jasmine Applications</display-name>
    <description>
    Jasmine Applications
    </description>
    <servlet>
    <servlet-name>LoginServlet</servlet-name>
    <servlet-class>examples.LoginServlet</servlet-class>
    <init-param>
    <param-name>java.naming.factory.initial</param-name>
    <param-value>weblogic.jndi.WLInitialContextFactory</param-value>
    </init-param>
    <init-param>
    <param-name>java.naming.provider.url</param-name>
    <param-value>t3://localhost:7001</param-value>
    </init-param>
    </servlet>
    <servlet>
    <servlet-name>ShowQuoteServlet</servlet-name>
    <servlet-class>examples.ShowQuoteServlet</servlet-class>
    <init-param>
    <param-name>java.naming.factory.initial</param-name>
    <param-value>weblogic.jndi.WLInitialContextFactory</param-value>
    </init-param>
    <init-param>
    <param-name>java.naming.provider.url</param-name>
    <param-value>t3://localhost:7001</param-value>
    </init-param>
    </servlet>
    <servlet>
    <servlet-name>CatalogServlet</servlet-name>
    <servlet-class>examples.CatalogServlet</servlet-class>
    <init-param>
    <param-name>java.naming.factory.initial</param-name>
    <param-value>weblogic.jndi.WLInitialContextFactory</param-value>
    </init-param>
    <init-param>
    <param-name>java.naming.provider.url</param-name>
    <param-value>t3://localhost:7001</param-value>
    </init-param>
    </servlet>
    <servlet-mapping>
    <servlet-name>LoginServlet</servlet-name>
    <url-pattern>/login/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>ShowQuoteServlet</servlet-name>
    <url-pattern>/showQuote/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>CatalogServlet</servlet-name>
    <url-pattern>/catalog/*</url-pattern>
    </servlet-mapping>
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>My secure resources</web-resource-name>
    <description>Resources to be placed under security control.</description>
    <url-pattern>/private/*</url-pattern>
    <url-pattern>/registered/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <role-name>guest</role-name>
    </auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>FORM</auth-method>
    <realm-name>WebApp</realm-name>
    <form-login-config>
    <form-login-page>/login.jsp</form-login-page>
    <form-error-page>/error.jsp</form-error-page>
    </form-login-config>
    </login-config>
    <!-- Security roles referenced by this web application -->
    <security-role>
    <description>The role allowed to access our content</description>
    <role-name>guest</role-name>
    </security-role>
    </web-app>
    pls give me a good solution this exception.. I tried lot..
    Thanks in Advance
    Regards
    Priya

    Your DOCTYPE references 2.4, it should be 2.3. WLS 8.1 supports J2EE 1.3 which was servlet 2.3.
    Servlet 2.4 is part of J2EE 1.4 and is supported by WLS 9.0/9.1. Also it uses XML Schema not a DTD.
    -- Rob
    WLS Blog http://dev2dev.bea.com/blog/rwoollen/

  • Web.xml parsing error

    Hello,
    I am a newbie to servlet programming. I am using Tomcat4.1.24. When I
    am trying out some examples, I got a bunch of parsing errors. After double-checking my web.xml, I still do not see why it caused so many parsing errors. I am using NotePad to edit web.xml, does that affect this? These errors are always about the last line and the last column.
    Very weird. Please help.
    web.xml
    <?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>Welcome to Tomcat</display-name>
    <description>
    Welcome to Tomcat
    </description>
    <servlet>
         <servlet-name>HelloWorld</servlet-name>
         <servlet-class>HelloWorld</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>*.myservlet</url-pattern>
    </servlet-mapping>
    <servlet>
         <servlet-name>Primes</servlet-name>
         <servlet-class>coreservlets.Primes</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Primes</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    </web-app>
    [ERROR] Digester - -Parse Error at line 29 column 11: The content of element typ
    e "web-app" must match "(icon?,display-name?,description?,distributable?,context
    -param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-conf
    ig?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resou
    rce-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,e
    jb-local-ref*)". <org.xml.sax.SAXParseException: The content of element type "we
    b-app" must match "(icon?,display-name?,description?,distributable?,context-para
    m*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,m
    ime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-r
    ef*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-lo
    cal-ref*)".>

    Hi.
    The answer is rather simple. The file is not valid against the XML v.1.0 standard. That's because all <servlet> elements must come first before all <servlet-mapping> elements. If you change the order of the Primes <servlet> element, the file is valid and Tomcat should not throw an exception.
    This is the correct web deployment descriptor:
    <?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>Welcome to Tomcat</display-name>
    <description>
    Welcome to Tomcat
    </description>
    <servlet>
    <servlet-name>HelloWorld</servlet-name>
    <servlet-class>HelloWorld</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>Primes</servlet-name>
    <servlet-class>coreservlets.Primes</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloWorld</servlet-name>
    <url-pattern>*.myservlet</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>Primes</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    </web-app>

  • Taglib element not allowed in web.xml conforming to web-app_2_4.xsd ?

    Hello,
    I want to configure taglibs in my web.xml file.
    The beginning of the file looks like this:
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
          version="2.4">I placed the following:      
    <taglib>
        <taglib-uri>/tags/struts-bean</taglib-uri>
        <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
    </taglib>element just after the welcome-file-list element. When I "validate XML" in Netbeans I get :
    cvc-complex-type.2.4.a: Invalid content was found starting with element 'taglib'. One of '{"http://java.sun.com/xml/ns/j2ee":description, "http://java.sun.com/xml/ns/j2ee":display-name, "http://java.sun.com/xml/ns/j2ee":icon, "http://java.sun.com/xml/ns/j2ee":distributable, "http://java.sun.com/xml/ns/j2ee":context-param, "http://java.sun.com/xml/ns/j2ee":filter, "http://java.sun.com/xml/ns/j2ee":filter-mapping, "http://java.sun.com/xml/ns/j2ee":listener, "http://java.sun.com/xml/ns/j2ee":servlet, "http://java.sun.com/xml/ns/j2ee":servlet-mapping, "http://java.sun.com/xml/ns/j2ee":session-config, "http://java.sun.com/xml/ns/j2ee":mime-mapping, "http://java.sun.com/xml/ns/j2ee":welcome-file-list, "http://java.sun.com/xml/ns/j2ee":error-page, "http://java.sun.com/xml/ns/j2ee":jsp-config, "http://java.sun.com/xml/ns/j2ee":security-constraint, "http://java.sun.com/xml/ns/j2ee":login-config, "http://java.sun.com/xml/ns/j2ee":security-role, "http://java.sun.com/xml/ns/j2ee":env-entry, "http://java.sun.com/xml/ns/j2ee":ejb-ref, "http://java.sun.com/xml/ns/j2ee":ejb-local-ref, "http://java.sun.com/xml/ns/j2ee":service-ref, "http://java.sun.com/xml/ns/j2ee":resource-ref, "http://java.sun.com/xml/ns/j2ee":resource-env-ref, "http://java.sun.com/xml/ns/j2ee":message-destination-ref, "http://java.sun.com/xml/ns/j2ee":message-destination, "http://java.sun.com/xml/ns/j2ee":locale-encoding-mapping-list}' is expected. [53]
    cvc-complex-type.2.3: Element 'web-app' cannot have character [children], because the type's content type is element-only. [71]
    XML validation finished.Indeed, looking at the web-app_2_4.xsd I cannot find a description for the taglib element.
    Where should a put taglibs ? Is it enough to include them in every JSP so I don't need to place them in web.xml ?
    Thank you.
    Vlad.

    web.xml 2.4 uses a <jsp-config> to enclose the
    <tag-lib>
    <jsp-config>
    <tag-lib>
    </tag-lib>
    </jsp-config>I believe that is the syntax. I will check when I get
    to my server comp.You are right. That's how it's done. Thanks a lot for the reply.
    I hope there were good reasons to break compatibility with the old format. There are a lot of examples out there that use the old one. Without knowing the reason for such a change, I find it very annoying.
    Thanks again
    Vlad.

  • Question on defining taglib in  web.xml

    I am using netbeans to develop a j2ee5 web application.
    I created a web application project using the wizard.
    When I defined a <taglib> in the web.xml, it detected an error.
    cvc-complex-type.2.4.a: Invalid content was found starting with element 'taglib'. One of '{"http://java.sun.com/xml/ns/javaee":description, "http://java.sun.com/xml/ns/javaee":display-name, "http://java.sun.com/xml/ns/javaee":icon, "http://java.sun.com/xml/ns/javaee":distributable, "http://java.sun.com/xml/ns/javaee":context-param, "http://java.sun.com/xml/ns/javaee":filter, "http://java.sun.com/xml/ns/javaee":filter-mapping, "http://java.sun.com/xml/ns/javaee":listener, "http://java.sun.com/xml/ns/javaee":servlet, "http://java.sun.com/xml/ns/javaee":servlet-mapping, "http://java.sun.com/xml/ns/javaee":session-config, "http://java.sun.com/xml/ns/javaee":mime-mapping, "http://java.sun.com/xml/ns/javaee":welcome-file-list, "http://java.sun.com/xml/ns/javaee":error-page, "http://java.sun.com/xml/ns/javaee":jsp-config, "http://java.sun.com/xml/ns/javaee":security-constraint, "http://java.sun.com/xml/ns/javaee":login-config, "http://java.sun.com/xml/ns/javaee":security-role, "http://java.sun.com/xml/ns/javaee":env-entry, "http://java.sun.com/xml/ns/javaee":ejb-ref, "http://java.sun.com/xml/ns/javaee":ejb-local-ref, "http://java.sun.com/xml/ns/javaee":service-ref, "http://java.sun.com/xml/ns/javaee":resource-ref, "http://java.sun.com/xml/ns/javaee":resource-env-ref, "http://java.sun.com/xml/ns/javaee":message-destination-ref, "http://java.sun.com/xml/ns/javaee":persistence-context-ref, "http://java.sun.com/xml/ns/javaee":persistence-unit-ref, "http://java.sun.com/xml/ns/javaee":post-construct, "http://java.sun.com/xml/ns/javaee":pre-destroy, "http://java.sun.com/xml/ns/javaee":message-destination, "http://java.sun.com/xml/ns/javaee":locale-encoding-mapping-list}' is expected.
    Here is my web.xml:
    <?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">
    <welcome-file-list>
    <welcome-file>
    index.jsp
    </welcome-file>
    </welcome-file-list>
    <taglib>
    <taglib-uri>/mytag</taglib-uri>
    <taglib-location>/WEB-INF/mytag.tld</taglib-location>
    </taglib>
    </web-app>

    As of servlet 2.4 (jsp 2.0), you'll have to move the taglib declarations inside a <jsp_config> element.
    <jsp-config>
        <taglib> ..........your stuff
    </jsp-config>ram.

Maybe you are looking for

  • Assigning a Source of Supply in a Purchase Order....Please Help!!!!

    Hello, Forum. I am a student and my final SAP project is due tomorrow. One of the steps is to create a Purchase Order certain specifications. I have defined the needed purchase requisitions for the Purchase order, but I am having a problem Assigning

  • Model number?

    I have an Apple PowerBook G4, 1.33GHz, 60 MB, 512 RAM. How can I find my specific model # and build date (generation)? From what I have seen, it looks like a 2004-2005 unit, but I have yet to locate anything specific on the laptop. Thanx in advance

  • Regards standard available text variables based on exceptions.

    Dear BI Experts, Please look into following link: [Standard Available Text Variables|http://help.sap.com/saphelp_nw70/helpdata/en/43/8464d082206353e10000000a11466f/content.htm] I need to use text variables in last box of above link (which are based o

  • Downloaded new version but it's put bookmarks etc in folder on desktop, how to reinstall ?

    I've installed the new version of firefox but there are no bookmarks transfered to this version, instead there's a folder appeared on the desktop called Old Firefox Data, how do i reinstall my bookmarks etc ?

  • IOS 8 has put my iPhone 5c into recovery mode

    I've downloaded IOS 8 on my mac ready for install on my iPhone. I knew i didn't have enough space or time, so once it stopped downloading i ejected the iPhone and my phone got stuck on the apple with the status bar. It then went into recovery mode, a