Problem in web.xml  -- servletcontext

Pls look at the code and web.xml file for invoking servlet.
index.html
<html>
<head>
<title>Servlet Context Example</title>
</head>
<body>
<form method="get" action="callservlet">
<input type="submit" value="Submit">
</form>
</body>
</html>ServletConExample.java
package com.servletcontext;
import java.io.IOException;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class ServletConExample extends HttpServlet {
     private static final long serialVersionUID = 1L;
     ServletContext con;
     public void init()
          con = getServletContext();
     public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException
          con.setAttribute("logname", "shobhit");
          response.sendRedirect("./com.servletcontext.TestServCon");
}TestServCon.java
package com.servletcontext;
import java.io.IOException;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class TestServCon extends HttpServlet {
     private static final long serialVersionUID = 1L;
     ServletContext con;
     public void init()
          con = getServletContext();
     public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException
          String str = (String)con.getAttribute("logname");
          response.getWriter().println("value of attribute logname is "+str);
}web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
     <servlet>
          <servlet-name>servletcontext</servlet-name>
          <servlet-class>com.servletcontext.ServletConExample</servlet-class>
     </servlet>
     <servlet-mapping>
          <servlet-name>servletcontext</servlet-name>
          <url-pattern>/callservlet</url-pattern>
     </servlet-mapping>
     <Welcome-file-list>
          <Welcome-file>index.html</Welcome-file>
     </Welcome-file-list>
</web-app>Error Page:
HTTP Status 404 - /ServletContext/com.servletcontext.TestServCon
type Status report
message /ServletContext/com.servletcontext.TestServCon
description The requested resource (/ServletContext/com.servletcontext.TestServCon) is not available.
Apache Tomcat/5.5.26 I think problem is in web.xml file. Can any help me to resolve this problem.
Thanks,
Shobhit

You must declare TestServCon.java on web.xml as you did for the first servlet
and in the sendRedirect use the following code :
response.sendRedirect("TestServCon");//   TestServCon is the servlet mapping you declared in web.xml
//or this
response.sendRedirect("./TestServCon");

Similar Messages

  • Problem with web.xml

    Hello,
    I have a big problem with web.xml.
    i can run the servlet demos with the default web.xml, but when i try to user a costum web.xml files, i receive a 404 page not found on a link.
    i have some dificulty to post here. but can somebody help my with my web.xml files?
    thanks for your help.
    have a nice day!

    Be careful with the place of your files and folders. It's possible that you've just mentioned the cause of your problem.
    My web.xml is
    <?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>gco</display-name>
    <description>gco webapplicaties</description>
    <servlet>
    <servlet-name>MopoController</servlet-name>
    <servlet-class>org.gertcuppens.controller.MopoController</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>MopoController</servlet-name>
    <url-pattern>/MOPO</url-pattern>
    </servlet-mapping>
    </web-app>
    When I want to call my web application locally, I use the URL http://localhost:8080/gco/MOPO.
    The http://localhost:8080 calls Tomcat. With /gco, Tomcat knows it should look for a folder gco inside the webapps folder. This one should contain a WEB-INF/web.xml folder for further instructions.
    With /MOPO Tomcat knows, having read the web.xml files of all webapps folders at start, it should look for a servlet with the name MopoController. And this MopoController points to the class org.gertcuppens.controller.MopoController. So, Tomcat knows where to find everything.
    Try to see whether your Tomcat can find everything inside the folders using your web.xml file.

  • Problem in Web.xml.........

    Hi to All,
    I installed the eval version of Crystal Reporst XI, created an example report with it and now I want to call my report from JSF Page.i followed the crxi_startup_guide_for_j2ee.i got the error in 'web.xml' file.the error is:
    "cvc-complex-type.2.4.a: Invalid content was found starting with element 'env-entry-value'. One of '{"http://java.sun.com/xml/ns/j2ee":env-entry-type}' is expected"
    here i shows my entry in web.xml file:
    <env-entry>
    <env-entry-name>jdbc/mydatabase name</env-entry-name>
    <env-entry-value>!com.microsoft.jdbc.sqlserver.SQLServerDriver!jdbc:odbc:mydatabase name</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
    im unable to get what was the problem.my environment is Tomcat 5.0.28,SQL2000.
    i created that report using ODBC connection.is it correct?suppose if i have to connect using JNDI means how to achive this?
    can any one get me out of this please!!
    Thanks in Advance,
    --RK                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    This is my web.xml file........
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" 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">
    <env-entry>
    <env-entry-name>jdbc/IMDB</env-entry-name>
    <env-entry-value>!com.microsoft.jdbc.sqlserver.SQLServerDriver!jdbc:odbc:IMDB</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
    <context-param>
    <param-name>com.sun.faces.verifyObjects</param-name>
    <param-value>false</param-value>
    </context-param>
    <context-param>
    <param-name>com.sun.faces.validateXml</param-name>
    <param-value>true</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
    </context-param>
    <context-param>
    <param-name>crystal_image_uri</param-name>
    <param-value>crystalreportviewers11</param-value>
    </context-param>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>
    <welcome-file-list>
         <welcome-file>
    index.jsp
    </welcome-file>
    </welcome-file-list>
    </web-app>
    Thnx,
    Rk

  • Problem with web.xml: getWebXmlParameter

    Hi,
    I've a problem with my web.xml.
    I need to work with tokens, for the different servers.
    For this, I normally use "getWebXmlParameter("...")", but now this doesn't work...
    My web.xml looks like this:
    <web-app>
       <servlet>
          <servlet-name>Faces Servlet</servlet-name>
          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
          <init-param>
             <param-name>config</param-name>
             <param-value>/WEB-INF/faces-config.xml</param-value>
          </init-param>
          <init-param>
             <param-name>debug</param-name>
             <param-value>3</param-value>
          </init-param>
          <init-param>
             <param-name>detail</param-name>
             <param-value>3</param-value>
          </init-param>
          <init-param>
               <param-name>webapp_address</param-name>
               <param-value>@WEBAPP_ADDRESS@</param-value>
          </init-param>
          <init-param>
               <param-name>webapp_port</param-name>
               <param-value>@WEBAPP_PORT@</param-value>
          </init-param>
          <init-param>
               <param-name>webapp_schemaDb</param-name>
               <param-value>@WEBAPP_SCHEMA_DB@</param-value>
          </init-param>
          <init-param>
               <param-name>webapp_datasource</param-name>
               <param-value>@WEBAPP_DATASOURCE@</param-value>
          </init-param>
       </servlet>
       <servlet-mapping>
          <servlet-name>Faces Servlet</servlet-name>
          <url-pattern>*.faces</url-pattern>
       </servlet-mapping>
       <welcome-file-list>
          <welcome-file>Language.faces</welcome-file>
       </welcome-file-list>
    </web-app>Normally I've a servlet which extends GenericServlet. In this class, I can use getWebXmlParameter("..")...
    How can I solve this problem?
    Thx a lot...
    Ann

    Hi,
    thx for the reply, but it stil doesn't work.
    In my class I put the following lines, for receiving the properties:
    Properties     props = new Properties();
    String file = "oltb_webapp.properties";
    props.load(this.getClass().getClassLoader().getResourceAsStream(file));
    private String jndiHostName = props.getProperty("webapp.address");He doesn't finde the file.. If I change the file-name to "resources/oltb_webapp.properties", he still doesn't find it...
    What am I doing wrong? I use this code all the time, and normally this works perfect... But with my webapplication, I've a problem...
    Thx a lot
    Ann

  • Problem with web.xml in jsp

    is there any api in jsp to retreive the path of web.xml

    request.getRealPath() is deprecated.
    Instead you should be using the method in ServletContext.
    In a JSP the servletContext is exposed as the implicit variable "application"
    In a Servlet you can get hold of it like:
    ServletContext application = getServletConfig().getServletContext();
    String path = application.getRealPath("/WEB-INF/web.xml");

  • Problem with web.xml, while migratig application from JBOSS 5.0 to JBOSS5.1

    Hi ,
    Earlier my application was running fine on JBOSS 5.0 .
    In that web.xml was like
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd"
         id="WebApp_ID" version="2.4">
         <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</param-value>
              </init-param>
              <load-on-startup>1</load-on-startup>
         </servlet>
         <!-- Timer Details -->
         <servlet>
              <servlet-name>perfMonCollector</servlet-name>
              <servlet-class>com.dbag.optimise.performancemonitor.timer.PerfMonitorCollector</servlet-class>
              <load-on-startup>4</load-on-startup>
              <init-param>
                   <param-name>cronExpr</param-name>
                   <param-value>0 0 0 */1 * ?</param-value>
                   <!--<param-value>0 */10 * * * ?</param-value> -->
              </init-param>
         </servlet>
         <servlet>
              <servlet-name>TransAnalysisCollector</servlet-name>
              <servlet-class>com.dbag.optimise.performancemonitor.timer.TransAnalysisCollector</servlet-class>
              <load-on-startup>3</load-on-startup>
              <init-param>
                   <param-name>cronExprTransAnalysis</param-name>
                   <param-value>*/30 * * * * ?</param-value>
              </init-param>
         </servlet>
         <!-- Timer Details -->
         <!-- PerfMonPoints Cache Generation on Server Startup -->
         <servlet>
              <servlet-name>perfMonGenerator</servlet-name>
              <servlet-class>com.dbag.optimise.performancemonitor.timer.PerfMonPointsGenerator</servlet-class>
              <load-on-startup>2</load-on-startup>
         </servlet>
         <!-- PerfMonPoints Cache Generation on Server Startup -->
         <!-- Standard Action Servlet Mapping -->
         <servlet-mapping>
              <servlet-name>action</servlet-name>
              <url-pattern>*.do</url-pattern>
         </servlet-mapping>
         <!-- The Usual Welcome File List -->
         <welcome-file-list>
              <welcome-file>jsp/index.jsp</welcome-file>
         </welcome-file-list>
    But now i have deployed my application on JBOSS 5.1 GA version.
    Now its giving exception.
    Caused by:
    org.xml.sax.SAXException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'init-param'. One of '{"http://java.sun.com/xml/ns/javaee":run-as, "http://java.sun.com/xml/ns/javaee":security-role-ref}' is expected. @ vfsfile:/local/dubeavi/jboss-5.1.0.GA/server/default/deploy/PerformanceMonitoringISE-1.0/WEB-INF/web.xml[28,15]
    at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$MetaDataErrorHandler.error(SaxJBossXBParser.java:426)
    at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
    at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
    at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:199)
    ... 41 more

    My new web.xml is like..
    <web-app
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         id="WebApp_ID"
         version="2.5">
         <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</param-value>
              </init-param>
              <load-on-startup>1</load-on-startup>
         </servlet>

  • 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/

  • Security problem in Web xml??

    Hi all,
    1)I have webapplication , I want to use form authentication to security it , under my root test , I have login.html, and secure folder ( group of pages),
    I have two tables in my sql server , they are users, and user_role, mean time I give every user role member.
    2) in my conf/server
    I have <Realm  className="org.apache.catalina.realm.JDBCRealm" debug="99"
                 driverName="com.microsoft.jdbc.sqlserver.SQLServerDriver"
              connectionURL="jdbc:microsoft:sqlserver://localhost:1433"
             connectionName="test" connectionPassword="1234"
                  userTable="users" userNameCol="Name" userCredCol="user_pass"
              userRoleTable="user_roles" roleNameCol="role_name" />in my root test, I have 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>
    <welcome-file-list>
            <welcome-file>Home.html</welcome-file>          
    </welcome-file-list>
    <security-constraint>
              <web-resource-collection>
                   <web-resource-name>SecurePages</web-resource-name>
                   <description>Security constraint for resources in the secure directory</description>
                   <url-pattern>/secure/*</url-pattern>
                   <http-method>GET</http-method>
              </web-resource-collection>
               <auth-constraint>
                           <role-name>member</role-name>
                            </auth-constraint>
              <user-data-constraint>
                   <description>SSL not required</description>
                   <transport-guarantee>NONE</transport-guarantee>
              </user-data-constraint>
         </security-constraint>
             <login-config>
                  <auth-method>FORM</auth-method>
                  <form-login-config>
                       <form-login-page>/Home.html</form-login-page>
                       <form-error-page>/ErrorLogin.jsp</form-error-page>
                  </form-login-config>
             </login-config>
    </web-app> if I take away the security <auth-constraint>
    <role-name>member</role-name>
    </auth-constraint> in my web xml the whole application work fine after login, jump from page to page, action to action. but if I add it , I only can go to one page , every time I click the link it jump back to login page .
    What mistake I make??
    Best regard.

    Hi,
    I'm assuming you invoking the JWS from JPD via a service control.
    In this case, the serviceControl has setUsername and setPassword method which will allow you to specify the username and password
    cheers
    Raj

  • Problem with the data source and web.xml

    I have an issue where JSC is removing my resource reference:
    <resource-ref>
    <description>Creator generated DataSource Reference</description>
    <res-ref-name>jdbc/localOracleDatabase</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    from the web.xml and sun-web.xml.
    The application has been working great in the IDE for months then wham, no more data source definition. I try and add the reference manually and the IDE takes it out. I am "NOT" adding it to the .xml's in the build area. Why is JSC removing the data source entry?

    This continues to be a problem. The only way that I can get around the problem is to drag a table from the data source onto the design pallete and then the datasource is added back to the web.xml. I can run fine for 10 or 15 runs then the entry is once again removed from the web.xml.
    Help please!

  • I  have some more problem in the  web.xml file and url-pattern in my  syste

    HI ALL!
    How can I create and place the web.xml and URL-parrten.Because I run
    the tomcat in my computer with ME system.
    Hoc

    what is the problem? please be more specific and detailed? check a sample web.xml file and make your own one and place it in your <application-context>\WEB-INF folder..

  • Problem displaying error page of web.xml when using JSF, Ajax4jsf

    Hi,
    My application is using MyFaces, RichFaces and Ajax4jsf. When i try to display error page configured in web.xml, i am getting exception "Error while processing error page".
    my web.xml contents are as follows:
    <?xml version="1.0"?>
    <web-app version="2.4" 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">
    <filter>
    <display-name>RichFaces Filter</display-name>
    <filter-name>richfaces</filter-name>
    <filter-class>org.ajax4jsf.Filter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>richfaces</filter-name>
    <servlet-name>faces</servlet-name>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
    <filter>
    <filter-name>extensionsFilter</filter-name>
    <filter-class>
    org.apache.myfaces.webapp.filter.ExtensionsFilter
    </filter-class>
    <init-param>
    <description>
    set the size limit for uploaded files. Format: 10 - 10 bytes 10k
    - 10 KB 10m - 10 MB 1g - 1 GB
    </description>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>100m</param-value>
    </init-param>
    <init-param>
    <description>
    Set the threshold size - files below this limit are stored in
    memory, files above this limit are stored on disk.
    Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
    </description>
    <param-name>uploadThresholdSize</param-name>
    <param-value>100k</param-value>
    </init-param>
    </filter>
    <filter>
    <filter-name>Seam Redirect Filter</filter-name>
    <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
    </filter>
    <filter>
    <filter-name>KTServletFilter</filter-name>
    <filter-class>com.kenexa.core.system.KTServletFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>extensionsFilter</filter-name>
    <url-pattern>/faces/*</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>Seam Redirect Filter</filter-name>
    <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>KTServletFilter</filter-name>
    <url-pattern>*.jsf</url-pattern>
    </filter-mapping>
    <!-- seam Listeners -->
    <listener>
    <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
    </listener>
    <listener>
    <listener-class>com.kenexa.kr.web.KRServletListener</listener-class>
    </listener>
    <servlet>
    <servlet-name>faces</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>faces</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    <error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/rc/systemError.jsf</location>
    </error-page>
    </web-app>
    As per the configuration, when exception is thrown out of the application, container tries to display systemError.jsp page. If we want to include the JSF tags in systemError.jsp page, the request should pass through FacesServlet, so in the <error-page> <location> tag systemError page is specified with the extention systemError.jsf though it's actual extention is .jsp
    When exception is thrown from the application container invoke the error page but, while rendering systemError.jsf page exception is thrown saying "Exception processing error page "systemError.jsp" "
    To solve this problem i've gone through several forums, materials.
    In one forum a guy said, JSF1.1 spec has some problem in displaying error pages. To solve this don't write <f:view> tags in the error page, use <f:subview> intstead. By reading this, i again changed the contents of systemError.jsp page replacing <f:view> by <f:subview>. But the error is still repeating.
    Finally what i found is, when we use Ajax4jsf in the application, its AjaxViewRender class is throwing exception while rendering error pages configured through web.xml.
    So what i did is i changed error page extention from .jsf to .jsp in the <location> tag. Now jsf won't come in the picture and remove JSF related tags from the systemError.jsp page.
    <error-page>
    <exception-type>java.lang.Throwable</exception-type>
    <location>/rc/systemError.jsp</location>
    </error-page>
    Any comments are welcome----------------------------------------------------------------

    I too iam facing the same problem could you advise if you have found any solutions
              -Ram

  • Problem in uri references in web.xml

    There are quite a few instances where external URIs are referenced in various sorts of files in WebAdmin. For example:
    index.jsp:
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:bean="BEAN" xmlns:logic="LOGIC" xmlns:html="HTML" xmlns:nested="NESTED" xmlns:custom="CUSTOM" xmlns:c="C" version="1.2">
    web.xml:
    <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">
    If Tomcat is running behind a firewall where the URIs are unreachable, it is very likely that Tomcat/WebAdmin will not start or will, at best, start in an impaired state.
    Cache all these external reference to local files.
    If it is, then download the external reference and update the URI to point to a local resource. For example:
    old:
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd
    new:
    http://emg-vip:12300/xml/ns/j2ee/web-app_2_4.xsd

    thank you for these possible problems and solutions.
    But are you really sure this problem occurs ?
    And URI is not an URL and normally the resources referenced by the URI's are not downloaded anyway.

  • Problem with mime type in web.xml file

    Hi everybody,
    I actually got a problem with mime types on Weblogic 6.0 under Linux.
    I read the documentation so I added the next lines in the web.xml file in
    the WEB-INF directory of my server :
    <mime-mapping>
    <extension>
    doc
    </extension>
    <mime-type>
    application/msword
    </mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>
    ppt
    </extension>
    <mime-type>
    application/vnd.ms-powerpoint
    </mime-type>
    </mime-mapping>
    Why can't I retrieve a .doc or .ppt files with an internet browser correctly
    ? I get only text/plain ...
    Can someone help me ?
    Regards,
    Alexis Berger

    I am having the same problem with doc and xsl. I have added this
    <mime-mapping>
    <extension>xls</extension>
    <mime-type>application/vnd.ms-excel</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>doc</extension>
    <mime-type>application/msword</mime-type>
    </mime-mapping>
    to my web.xml. I even restarted the server. I still see doc and xsl in binary.
    Is there some other setting that needs to take place?
    I am using WL6.1 with fixpack 1.
    I can see the doc and excel files in the browser if I don't go through the weblogic
    server. That just confirms it's not my browser.
    Kumar Allamraju <[email protected]> wrote:
    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <html>
    It works fine for me in 6.1 SP1.
    <br><br>
    If the following doesn't work , can you
    <br>try application/winword instead of application/msword?
    <p>--
    <br>Kumar
    <p>Siming Mu wrote:
    <blockquote TYPE=CITE>Hi,
    <p>I setup in my web.xml a mime mapping as follows,
    <p><mime-mapping>
    <br><extension>doc</extension><mime-type>application/msword</mime-type>
    <br></mime-mapping>
    <p>When I specify a test.doc url, the doc file appears in my browser
    as
    binary data
    <br>instead of download.
    <p>Please reference change request 055002, which decribes this problem. 
    According
    <br>to edocs, it has been fixed in wls6.1sp1.
    <p>But I am seeing it fixed.  Am I doing anything wrong? Thanks.
    <p>Siming</blockquote>
    </html>

  • Problems with jsp-error page in web.xml

    Hello everybody, I have a confusing problem concerning the use of jsps as error pages for 404-errors.
    I inserted the following lines in my web.xml file:
    <error-page>
    <error-code>404</error-code>
    <location>/personal404.jsp</location>
    </error-page>
    The problem is: when an 404 occurs, instead of showin the personal404.jsp, the browser tells me that it tries to download a file which it can't (it tries to download the mis-spelled file). When I try to redirect the 404 to a static html-page, as in
    <error-page>
    <error-code>404</error-code>
    <location>/personal404.html</location>
    </error-page>
    everything works fine.
    Please, does anybody have any idea or suggestion, what I am doing wrong?
    Thanks in advance,
    Sebastian

    Hi Ivan,
    I tried it, but there wasn't any difference.
    I'll try to explain in more detail what happens:
    Imagine my application has the following root-path
    http://myServerName:port/mainRoot/
    When I try the following URL:
    http://myServerName:port/mainRoot/pageThatDoesNotExist.jsp, the browser tells me, it tries to download the file pageThatDoesNotExist.jsp from myServerName and that it can't find that file.
    The same happens, when I type http://myServerName:port/mainRoot/pathThatDoesNotExist/pageThatDOESExist.jsp, except that the browser tries to download the file pageThatDOESExist.jsp which (again) it can't.
    I have located the files 404.jsp and 404.html in the same directory, so I don't think this is a path-related problem, because everything works fine, when I specify the 404.html as the target error page (i.e. the browser displays the 404.html when I type the URLs shown above).
    I don't know if I'm making this clear, but maybe you get the idea.
    Sebastian

  • Problems with error-page in web.xml and page caching

    Having a few problems with error pages and web.xml with browsers caching the error pages and strange errors coming out of weblogic.servlet.intenal.WebAppServletContext
    I'm trying to set a web app up so that all http errors and all exceptions are routed thruogh predefined resources. For now, I'm simply send 400 errors to 400.html and the ServletException, IOException and RuntimeException to respective html pages.
    What I'm finding is that the error codes work fine but the exceptions are only be routed to the correct error page for the first call to the servlet after server restart.
    So for example, I have my servlet throwing a ServletException as a test case. The weblogic server log shows that ServletException is thrown, and the correct error page for ServletExceptions is shown.
    If I change the Servlet code to throw IOException in place of SevletException, the weblogic.log shows that IOExceptyion is being thrown (so the servlet has deployed successfully), however the Servletxception error page is shown on the browser.
    I'm using IE6 and I've changed the setting such that a new page is requested every time using the tools-internet options-temp internet files-settings option to "check for new versions of stored pages: Every visit to the page".
    Despite this, the servlet exception error page still appears.
    If you clear the cache from the temp intenet files->delete files IE option, the correct errror page will be shown so it appears that the browser cache is being used after all.
    everytime I delete the temp intenet files I get the correct error page on the first request after but then not after that.
    I have implemented the service method for this test to throw the exceptions - does this make a differecne?
    As a test, I have moved the imlpementation to the doGet method instead bu I now get a strange eror from weblogic comlpaining about an arrayOutOfBoundsException because eror codes in the web.xml are not supported! - see error above.
    Any help is appreciated

    After further investigation: -
    There are no problems with error pages based on error codes, only error exceptions.
    As a test case, I have a service method in a servlet throwing either one of the three exception types that servlets can throw (Runtime, Servlet & IO) the following rules apply. The exception to be thrown is hardcoded and is changed and the web app rebuilt each time. The correct web.xml has been deployed to the app server (checked through console). the webapp is being redeployed correctly - this can be seen in the weblogic log, where the correct exception is reported.
    I am using WLS 8.1, Servlet 2.3, JDK 1.4.1_02
    In all cases, the weblogic log reports that the servlet is throwing the exception as expected.
    Despite having set error-page for exception javax.servlet.ServletException, the exceptions are diverted to the error page that has been set up for http error code 500
    The error page for ServletException is therefore never reached.
    I have the browser set to request pages every time it is asked.
    Once the servlet has thrown an IOException, the only way to get the browser to report an IO or Runtime exception error-page is to clear the browser cache. Restarting the server has no effect.
    Once the servlet has responded with ANY exception, it is not possible to get it to report a ServletException (which is incorrectly reported as a 500 anyway) unless the cache is cleared. Restarting the server has no effect.
    In the case where the servlet throws ServletException, it has no root exception. The servlet 2.3 spec states that if ServletException is thrown but cannot be found in the error pages, the root excpetion will be extracted and the error page list traversed again. Knowing that the RuntimeException error page is correct shown when RuntimeException is throwm, I have nested this inside the ServletException, however error page for http error 500 is still shown.
    I don't believe this is a WLS 8.1 problem, as the console shows that the correct exception is thrown each time. this is backed up by the fact that the correct exception page is thrown when the cache is cleared regardless of what exception was previousdly thrown by the servlet. This excludes ServletException which is always incorrectly thrown as a 500.

Maybe you are looking for

  • Submit button doesn't work unless I use the record wizard

    If I create a form using the data objects/insert record/record wizard my form works fine..ie..the date gets inputed into my mysql database.   However, if I create the form myself without the record wizard my submit button does not work.   Any suggest

  • ECP not displayed correctly

    Hi, When using ECP on browsers other than Internet Explorer, it loads but does not display the content correctly. We only get to see the links. Unfortunately I cannot add an image to this post. How can I fix this so that all browsers (Safari, Chrome,

  • Authorization group restriction

    Hi , I would like to know how to restrict authorization group FCAR and FCAP.We could see it is related to F_BKPF_BES object .It seems the same authorization object should be given the following access --display access for documents asigned to authori

  • Macbook pro freezes after coming out of sleep mode

    Lately my 13" early 2011 Macbook Pro has been locking up when in sleep mode. All I get is a blank screen and the cursor which responds, but no buttons pushed on the keyboard resolve issue. Resolution thus far has been to hard boot the macbook... Anyo

  • Can SAP BPM address progressive approvals?

    Hello, We are looking to build a mobile approvals app based on SAP ERP. The requirement is as follows. Amount < 100K - A approves 100K < Amount < 1MN - A approves first and then B Approves (B reviews A's comments) 1 MN < Amount < 10 MN - C approves a