Adding servlet entry in web.xml of j2ee engine

Hi ,
I want a servlet to be loaded on startup of the j2ee engine SAP WAS which is basically flex based (MessageBrokerServlet). 
The init param for the servlet is not accessible or cannot be initialized in init method of the servlet using the servletconfig object.
This is when the servlet is used as a portal component of type servlet.
So as to load the servlet and the servlet being able to access the init param i would be changing the web.xml of the sap j2ee engine (NW CE 7.1). are there any other effects of the same or is it fine if i just add this param in the web.xml
    <servlet>
        <servlet-name>MessageBrokerServlet</servlet-name>
        <display-name>MessageBrokerServlet</display-name>
        <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
        <init-param>
            <param-name>services.configuration.file</param-name>
            <param-value>/WEB-INF/flex/services-config.xml</param-value>
       </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

Hi ,
Vivek in case my servlet is part of the Portal Application as PortalComponent how do i define init parameters  that can be accessed in the servlet.
The config file would be accessed in the init method of the servlet how do i do that when the servlet is added as PortalComponent in PortalApplication. The servlet config file needs to accessed in t he init method.
The load on startup thing would be taken care of by setting parameter startup = true of application properties.
Regards
Srikumar V

Similar Messages

  • Is there any alternative for adding servlet name in Web.xml?

    Hi,
    I am new to Weblogic and I have an application(Ear file) which was developed
    in Websphere and I am trying to install in weblogic 8.1. I have installed my application
    in Websphere without adding servlet entries in Web.xml and it was working fine.
    I have installed the same Ear file in Tomcat and added the
    following to make all my all servlets work.
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    Is there any alternative of doing like that in WebLogic instead of adding each
    and every servlet entry in web.xml because my application has around 200 servlets
    Thanks&Regards,
    Gopi.

    Is Servlet servlet same as weblogic.servlet.ServletServlet?
    Deepak
    Rob Woollen <[email protected]> wrote:
    Yes, you could register weblogic.servlet.ServletServlet.
    -- Rob
    Gopi Krishna wrote:
    Hi,
    I am new to Weblogic and I have an application(Ear file) whichwas developed
    in Websphere and I am trying to install in weblogic 8.1. I have installedmy application
    in Websphere without adding servlet entries in Web.xml and it was workingfine.
    I have installed the same Ear file in Tomcat and added the
    following to make all my all servlets work.
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    Is there any alternative of doing like that in WebLogic instead ofadding each
    and every servlet entry in web.xml because my application has around200 servlets
    Thanks&Regards,
    Gopi.

  • Calling servlet with out entry in web.xml

    Hi
    I want to know whether can a servlet be invoked with out having an entry in web.xml.Because to my knowledge when ever an entry is made in teh web.xml the <url-pattern> and the class file will be stored as key value combination it is only then when ever a request is made the server gets the class taht is to be invoked from the <url-pattern> that is passed from the client side.
    Is ther any way by whihc we can call the servlet directly with out an entry in web.xml
    Thanks in advance
    Ajithkumar.S

    Interesting that it is possible on Tomcat anyway.
    What's the real benefit of not having a Servlet
    definied in web.xml?
    The only benefit I see is that
    you don't need to understand/read/change XML when
    adding or removing a servlet. That isn't worth that
    imho. What are the other benefits?The only thing I can think of is , to be able to quickly access a Servlet that you've just written, because it takes additional steps to define it in the web.xml.
    I think it would be a security concern (of some sort) , if the Servlet's class is known, that's why it is better to access a Servlet with a mapping from web.xml

  • Admin UI for editing environment entries (i.e. env-entry in web.xml)

    Hi there,
    just wanted to know if Weblogic nowadays features a UI for post-deployment editing of environment entries such as the ones declared via <env-entry> in web.xml ( [http://download.oracle.com/docs/cd/E21764_01/web.1111/e13712/web_xml.htm#autoId30] ). So far, I'm using a deployment plan to re-configure these things at the time of each deployment, which works but which is also probably not the most flexible solution.
    Thanks in advance,
    Chris

    Ah, I was trying to do a lookup from session bean for the env-entry defined in
    the web.xml. After reading the J2EE spec, I see this just won't work. env-entries
    are only accessible from within the component where they are defined.
    Still the error message with "comp.env" instead of the expected "comp/env" is
    a bit confusing.
    Not much traffic in this newsgroup, is there?
    Steve
    "Steve Ditlinger" <[email protected]> wrote:
    >
    >
    >
    If I create an "env-entry" block for a name (e.g. "MySchemaName") in
    my web.xml
    file and deploy the web app, I should be able to look up the name from
    my webapp
    with the line:
    <br>
    myInitialContext.lookup("java:comp/env/MySchemaName");
    <br>
    However when I do that I get the error message:
    <br>
    javax.naming.NameNotFoundException: Unable to resolve 'java:comp.env/MySchemaName'
    <br>
    Note that the "comp/env" prefix has been changed to "comp.env". This
    worked under
    WL 6.1. Is this a bug in WL 7's JNDI or a bug in the error message or
    both or
    something else altogether?
    The immediately previous line successfully performs an EJBHome lookup
    using the
    same Initial Context object. The main difference is that the EJBHome
    name is defined
    thru the EJB deployment descriptors, not the web.xml.
    Thanks,
    Steve

  • Servlet mappings in web.xml is not picking up propelry

    Hi,
    I am developing on java web application in Jdeveloper and trying to deploy in integrated wls.
    i have one jsp page, and one java servlet. and added url-pattern and servlet mappings in web.xml, but when running the jsp, it is not picking up the servelt . I am getting the error saying 'The server has not found anything matching the Request-URI.'
    Can you help me in fixing this issue.
    Thanks in advance.

    Hi,
    I have one Test.html file under public_html folder, and in that html form action url is as below:
    <form action="/servlet/testServlet" method="post">
    .</form>
    and my web.xml content is:
    <web-app 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"
    version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
    <servlet>
    <display-name>TestServlet</display-name>
    <servlet-name>TestServlet</servlet-name>
    <servlet-class>oracle.apps.servlet.TestServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>TestServlet</servlet-name>
    <url-pattern>/servlet/testServlet</url-pattern>
    </servlet-mapping>
    </web-app>
    When i run the HTML page, the URL is : http://local:7101/Application1-Test-context-root/Test.html
    and when click on button, its redirecting to http://local:7101/servlet/testServlet and getting the error saying that 'The server has not found anything matching the Request-URI' ideally it shuld redirect to http://local:7101/Application1-Test-context-root/servlet/testServlet.
    let me know what could be the problem?

  • Order of servlet mapping in web.xml

    Hello,
    is the order of multiple <servlet-mapping> in web.xml important? Or it doesn't matter in which order they are declared?
    For example, if i have two controllers, one is
    <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
    </servlet>
    and the second:
      <servlet>
        <servlet-name>FrontController</servlet-name>
        <servlet-class>servlets.FrontController</servlet-class>
      </servlet>
    and the mapping are:
       <servlet-mapping>
        <servlet-name>FrontController</servlet-name>
        <url-pattern>/jsf/*</url-pattern>
      </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>where /jsf/ contains jsp pages containing jsf components.
    is the order important?
    And may second question is:
    if i call the jsp page test.jsf in /jsf/test.jsp , which controller is responseble? Faces servlet or Frontcontroller?

    Here is what the 2.4 specification says on the matter (section SRV.11.1):
    >
    The path used for mapping to a servlet is the request URL from the request
    object minus the context path and the path parameters. The URL path mapping rules below are used in order. The first successful match is used with no further matches attempted:
    1. The container will try to find an exact match of the path of the request to the
    path of the servlet. A successful match selects the servlet.
    2. The container will recursively try to match the longest path-prefix. This is done by stepping down the path tree a directory at a time, using the �/� character as a path separator. The longest match determines the servlet selected.
    3. If the last segment in the URL path contains an extension (e.g. .jsp), the servlet container will try to match a servlet that handles requests for the extension. An extension is defined as the part of the last segment after the last �.� character.
    4. If neither of the previous three rules result in a servlet match, the container will attempt to serve content appropriate for the resource requested. If a "default" servlet is defined for the application, it will be used.
    The container must use case-sensitive string comparisons for matching.
    It also notes that in prior versions of the specification these were only a suggestion so if you are on servlet 2.3 or prior, you need to consult the documentation for your container.
    So, to answer your questions, no, order in the descriptor is not important.
    Also, based on the rules above, using your mappings, any URL starting with /jsf will be handled by FrontController including /jsf/test.jsp and /jsf/test.jsf.

  • How to run java servlet without using Web.xml?

    How to run servlet without using Web.xml? From a book, I know that web.xml descriptor is optional, but the book doesn't tell us how to run java servelet without web.xm descriptor. So how to do that? Thanks a lot.

    How to run servlet without using Web.xml?But Tomcat now uses a web.xml for its global server-wide configuration.
    If you'd like to invoke a servlet with:
    http://host/servlet/ServletName
    you have to enable the invoker servlet.
    [from an HTML]
      <FORM METHOD="POST" ACTION="/servlet/HGrepSearchSJ">
    [from resin.conf of Resin Web Server 2.1.12]
      <!--
         - The "invoker" servlet invokes servlet classes from the URL.
         - /examples/basic/servlet/HelloServlet will start the HelloServlet
         - class.  In general, the invoker should only be used
         - for development, not on a deployment server, because it might
         - leave open security holes.
        -->
      <servlet-mapping url-pattern='/servlet/*' servlet-name='invoker'/>
    [from TOMCAT5.0.19/conf/web.xml, a global server-wide web.xml file]
      <!-- The "invoker" servlet, which executes anonymous servlet classes      -->
      <!-- that have not been defined in a web.xml file.  Traditionally, this   -->
      <!-- servlet is mapped to URL pattern "/servlet/*", but you can map it    -->
      <!-- to other patterns as well.  The extra path info portion of such a    -->
      <!-- request must be the fully qualified class name of a Java class that  -->
      <!-- implements Servlet (or extends HttpServlet), or the servlet name     -->
      <!-- of an existing servlet definition.     This servlet supports the     -->
      <!-- following initialization parameters (default values are in square    -->
      <!-- brackets):                                                           -->
      <!--                                                                      -->
      <!--   debug               Debugging detail level for messages logged     -->
      <!--                       by this servlet.  [0]                          -->
        <servlet>
            <servlet-name>invoker</servlet-name>
            <servlet-class>
              org.apache.catalina.servlets.InvokerServlet
            </servlet-class>
            <init-param>
                <param-name>debug</param-name>
                <param-value>0</param-value>
            </init-param>
            <load-on-startup>2</load-on-startup>
        </servlet>
    ---comment out below----------------------------------------------------------
        <!-- The mapping for the invoker servlet -->
    <!--
        <servlet-mapping>
            <servlet-name>invoker</servlet-name>
            <url-pattern>/servlet/*</url-pattern>
        </servlet-mapping>
    -->

  • Servlet registration in web.xml with weblogic 5.1 sp10

    I've been developing this site using one "dispatch"
              servlet as my traffic cop for my framework. i now
              have to do this charting thing and i plan to
              stream in an image from a servlet. this means adding
              another servlet to the application. i've edited the
              web.xml according to the standerd and WL still pukes
              on startup saying
              "Error parsing descriptor in Web application
              'c:/workspace/com/somthing/'
              org.xml.sax.SAXParseException: Element "web-app" does
              not allow "servlet" here."
              below is my web.xml file...
              <?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>
              <description>
              blah blah
              </description>
              <servlet>
              <servlet-name>
              WebDispatcher
              </servlet-name>
              <servlet-class>
              com.somthing.somthin.WebDispatcher
              </servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>
              WebDispatcher
              </servlet-name>
              <url-pattern>
              /dispatch
              </url-pattern>
              </servlet-mapping>
              <servlet>
              <servlet-name>
              AssetChartServlet
              </servlet-name>
              <servlet-class>
              com.something.somthn.charts.ChartServlet
              </servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>
              ChartServlet
              </servlet-name>
              <url-pattern>
              /Chart
              </url-pattern>
              </servlet-mapping>
              some jsp tags
              </web-app>
              What am I doing wrong? Do I have to register the
              servlet in the weblogic.properties file? If so do I add the line
              weblogic.httpd.register.chart=com.somthing.somthin.charts.ChartServlet
              And the the (local)url would be http://localhost:7001/Chart ? And if
              this is the case where/how do I do the url mapping bit for this?
              Any help would be greatly appreciated.
              thanks,
              -Gabe
              

    To answer Mike's follow-up question, yes. From the DTD for the web.xml
              file:
              <!ELEMENT web-app (icon?, display-name?, description?, distributable?,
              context-param*, servlet*, servlet-mapping*, session-config?,
              mime-mapping*, welcome-file-list?, error-page*, taglib*,
              resource-ref*, security-constraint*, login-config?, security-role*,
              env-entry*, ejb-ref*)>
              The ordering of elements must be followed if they are specified in the DTD.
              Move your first <servlet-mapping> element to after the second <servlet>
              element and it should work just fine.
              -chris
              "Mike Reiche" <[email protected]> wrote in message
              news:[email protected]...
              >
              >
              >
              > Hmmm... do all the <servlet> </servlet> need to come before all the
              <servlet-mapping>
              > ?
              >
              > Mike
              >
              >
              > [email protected] (gabe) wrote:
              > >I've been developing this site using one "dispatch"
              > >servlet as my traffic cop for my framework. i now
              > >have to do this charting thing and i plan to
              > >stream in an image from a servlet. this means adding
              > >another servlet to the application. i've edited the
              > >web.xml according to the standerd and WL still pukes
              > >on startup saying
              > >
              > >"Error parsing descriptor in Web application
              > >'c:/workspace/com/somthing/'
              > >org.xml.sax.SAXParseException: Element "web-app" does
              > >not allow "servlet" here."
              > >
              > >below is my web.xml file...
              > >------------------------------
              > >
              > ><?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>
              > >
              > > <description>
              > > blah blah
              > > </description>
              > >
              > > <servlet>
              > > <servlet-name>
              > > WebDispatcher
              > > </servlet-name>
              > > <servlet-class>
              > > com.somthing.somthin.WebDispatcher
              > > </servlet-class>
              > > </servlet>
              > > <servlet-mapping>
              > > <servlet-name>
              > > WebDispatcher
              > > </servlet-name>
              > > <url-pattern>
              > > /dispatch
              > > </url-pattern>
              > > </servlet-mapping>
              > >
              > > <servlet>
              > > <servlet-name>
              > > AssetChartServlet
              > > </servlet-name>
              > > <servlet-class>
              > > com.something.somthn.charts.ChartServlet
              > > </servlet-class>
              > > </servlet>
              > > <servlet-mapping>
              > > <servlet-name>
              > > ChartServlet
              > > </servlet-name>
              > > <url-pattern>
              > > /Chart
              > > </url-pattern>
              > > </servlet-mapping>
              > >
              > > ...
              > > some jsp tags
              > > ...
              > >
              > ></web-app>
              > >---------------------------------
              > >What am I doing wrong? Do I have to register the
              > >servlet in the weblogic.properties file? If so do I add the line
              > >
              > >weblogic.httpd.register.chart=com.somthing.somthin.charts.ChartServlet
              > >
              > >And the the (local)url would be http://localhost:7001/Chart ? And if
              > >this is the case where/how do I do the url mapping bit for this?
              > >
              > >Any help would be greatly appreciated.
              > >
              > >thanks,
              > >
              > >-Gabe
              >
              

  • Weblogic.servlet.reloadCheckSecs in web.xml not working

    Given the following web.xml file:
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
              1.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              <web-app>
              <context-param>
              <param-name>weblogic.servlet.reloadCheckSecs</param-name>
              <param-value>100</param-value>
              </context-param>
              <servlet>
              <servlet-name>CookieCounter</servlet-name>
              <servlet-class>servlets.CookieCounter</servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>CookieCounter</servlet-name>
              <url-pattern>monster</url-pattern>
              </servlet-mapping>
              <welcome-file-list>
              <welcome-file>hello.html</welcome-file>
              </welcome-file-list>
              <error-page>
              <error-code>404</error-code>
              <location>/error.jsp</location>
              </error-page>
              </web-app>
              It seems the weblogic.servlet.reloadCheckSecs property is not taking effect.
              The
              default value of -1 is always used. I did stop and restart weblogic.
              I also trid to set the servlet classpath in the web.xml file with
              weblogic.servlet.classpath
              property and it did not change the classpath for the servlet. It seems that
              other
              items are working such as adding new servletrs to the web application. Note
              that
              this is the cookie sample application that installes with the beta 2
              download.
              Thanks,
              Dan.
              

    Hi All:
    Thanks for all your help regarding the adfAuthentication success_url. Now I am able to configure to make this work. But now I am facing another issue i.e. I am getting 401 Not authorized message when the success_url is pointed to the jspx page.
    Note: I am using custom login module similar to DBProcOraDataSourceLoginModule so my roles are stored in the custom Role class. So I am not sure how to pass this role info to the security in ADF in order to authorize the page to be viewed.
    Could you please help and can you point me to any specific link.
    Thanks & Regards
    Sridhar Doki

  • Validation error when using env-entry in web.xml

    I've added an env-entry element to my web.xml and it falls over at deploy time with a validation error. However, from what I can see, this is valid based on the schema.
    And infact, it matches the example in the weblogic doco - http://edocs.bea.com/wls/docs103/webapp/web_xml.html#wp1025195
    The error I'm getting is:
    <17/12/2008 11:45:56 AM EST> <Error> <J2EE> <BEA-160197> <Unable to load descriptor D:\workspace\source_checkout\investment_control\ic-web\src\main\webapp/WEB-INF/web.xml of module ic-web.war. The error is weblogic.descriptor.DescriptorException: VALIDATION PROBLEMS WERE FOUND
    problem: cvc-complex-type.2.4a: Expected elements 'mapped-name@http://java.sun.com/xml/ns/javaee injection-target@http://java.sun.com/xml/ns/javaee' instead of 'env-entry-type@http://java.sun.com/xml/ns/javaee' here in element env-entry@http://java.sun.com/xml/ns/javaee:<null>
         at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:234)
         at weblogic.descriptor.internal.MarshallerFactory$1.evaluateResults(MarshallerFactory.java:221)
    My web.xml looks like:
    <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/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5">
         <description>IC Web</description>
         <env-entry>
              <env-entry-name>aEntry</env-entry-name>
              <env-entry-value>aValue</env-entry-value>
              <env-entry-type>java.lang.String</env-entry-type>
         </env-entry>
    </web-app>
    Any suggestions???

    Found a resolution to this in the end.
    Unless you have the sub-elements in the order below, it will get validation errors.
    <env-entry>
    <env-entry-name>maxAmount</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>aString</env-entry-value>
    </env-entry>
    A bit weird and very frustrating....

  • Env-entry in web.xml and 6.0 sp4

    Does anyone know if iws 6.0 sp4 supports env-entry elements in web.xml???
    According to servlet specs 2.2 it should support it since it has JSP support.
    From 2.3 specs:
    "The following addtional elements exist in the web application deployment
    descriptor to meet the requirements of web containers that are JSP enabled or part
    of a J2EE application server. They are not required to be supported by containers
    wishing to support only the servlet specification.:
    � taglib
    � syntax for looking up JNDI objects (env-entry, ejb-ref, ejb-local-ref, resourceref,
    resource-env-ref)
    See the DTD comments for further description of these elements."

    Additional info...actually the code throws a NamingException.

  • Trouble adding alias to the web.xml file (External Facing Portal)

    I'm trying to implement the external facing portal. I don't really have any real custom content to add to it but have just created an iView that contains a webpage that's contained within a copy of the light framework.
    I'm having trouble adding or accessing the alias that I've created to go to this iView.
    I can test my iView by adding it to the master rule collection under one of the predefined aliases in the web.xml (e.g. portal/anonymous etc) but when i define my own (e.g. "ext" etc) and then go to http://portal:<port>/irj/ext I'm just getting an error:
      The requested resource does not exist.
      Details:   Go to main page of this application!
    This is what my entry in the web.xml file looks like:
    <web-app>
    <display-name>The Java iView Runtime</display-name>
    <listener>
    <listener-class>
    com.sapportals.portal.prt.session.HttpSessionHandler
    </listener-class>
    </listener>
    <servlet>
    <servlet>
    <init-param>
       <param-name>
          portal/anonymous
       </param-name>
       <param-value>
    anonymous=1,proxy=0,low_bandwidth=0,include_in_url=1,include_application_name_in_url=1
       </param-value>
    </init-param>
    <init-param>
      <param-name>
       ext
      </param-name>
      <param-value>
    anonymous=1,proxy=0,low_bandwidth=1,include_in_url=1,include_application_name_in_url=1
      </param-value>
    <init-param>
    </servlet>
    My master rule collection seems to be correct, since I can test the iView etc by adding it to a predefined alias. I've tried closing all browsers etc. Nothing seems to work.
    Any ideas what this could be?
    Thanks!
    I'll award points for any help.

    Hi Beau
    Just Have a try.
    In the servlet mapping add the following entry.
    <servlet-mapping>
    <servlet-name> gateway </servlet-name>
    <url-pattern> /portal/* </url-pattern>
    </servlet-mapping>
    <b><servlet-mapping>
    <servlet-name> gateway </servlet-name>
    <url-pattern> /ext/* </url-pattern>
    </servlet-mapping></b>
    <servlet-mapping>
    <servlet-name> prt </servlet-name>
    <url-pattern> /irj/* </url-pattern>
    </servlet-mapping>
    Restart after making the changes.
    Regards
    Geogi Luke

  • Can i run a servlet without a web.xml file for servlet mapping?

    Hello everyone.
    The code i want to run compiles and everythink looks ok.
    It produces the .class file.
    I run Tomcat 4.1 and i build my Web site with Dreamweaver.
    I have a form in a page and i want to send the data upon form completion to a database i already have build with MySql.
    The database is up and running and the server is set-up ok.
    I have changed the port in Tomcat to run on port 80.
    The directory i have my site is
    Tomcat41\webapps\ROOT\se
    and the directory where i keep the servlet class is
    Tomcat41\webapps\ROOT\se\WEB-INF\servlet
    I have a web.xml file to map the servlet and placed it in
    Tomcat41\webapps\ROOT\se\WEB-INF
    In the Form action i write action:"/servlets/Classes/GroupRegistration"
    and I RECEIVE AN 404 ERROR FROM APACHE.
    Somethink is wrong .
    The following is the code from the GroupRegistration.java file
    and follws the web.xml file.
    Please Help.
    import java.sql.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class GroupRegistration extends HttpServlet
    Connection con;
    public void doPost (HttpServletRequest req, HttpServletResponse res)
                             throws ServletException, java.io.IOException
         handleForm(req, res);
    public void init() throws ServletException {
         try{
         /* Loading the driver for the database */
         Class.forName("com.mysql.jdbc.Driver");
         Connection Con = DriverManager.getConnection("jdbc:mysql://localhost/se?user=luser&password=");
         catch (ClassNotFoundException e) {
         throw new UnavailableException("Couldn't load JdbcOdbcDriver");
         catch (SQLException e) {
         throw new UnavailableException("Couldn't get db connection");
         private void handleForm(HttpServletRequest req, HttpServletResponse res)
         throws ServletException {
         //ServletOutputStream out = res.OutputStream();
         //res.setContentType("text/html");
         //Extract the form Data Here
         String group = req.getParameter("GroupNo");
         String Name1 = req.getParameter("Name1");
         String LoginID1 = req.getParameter("LoginID1");
         String Name2 = req.getParameter("Name2");
         String LoginID2 = req.getParameter("LoginID2");
         String Name3 = req.getParameter("Name3");
         String LoginID3 = req.getParameter("LoginID3");
         String Name4 = req.getParameter("Name4");
         String LoginID4 = req.getParameter("LoginID4");
         String URL = req.getParameter("URL");
         String Title2 = req.getParameter("Title2");
         String date = req.getParameter("date");
         String INSERT = "INSERT INTO registration (groupno, name1, loginid1, name2, loginid2, name3, loginid3, name4, loginid4, url, topic, date) VALUES (" + group + "," + Name1 + "," + LoginID2 + "," + Name2 + "," + LoginID2 + "," + Name3 + "," + LoginID3 + "," + Name4 + "," + LoginID4 + "," + URL + "," + Title2 + "," + date + ")";
         PreparedStatement pstmt = null;
         try{
         pstmt = con.prepareStatement(INSERT);
         pstmt.executeUpdate();
         catch (SQLException e) {
         throw new ServletException(e);
         finally {
         try {
         if (pstmt != null)pstmt.close();
         catch (SQLException ignored){
    The web.xml file
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <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">
    <servlet>
    <servlet-name>GroupRegistration</servlet-name>
    <servlet-class>GroupRegistration</servlet-class>
    </servlet>
    <servlet-maping>
    <servlet-name>GroupRegistration</servlet-name>
    <url-pattern>/myGroupRegistration</url-patern>
    </servlet-mapping>
    </web-app>
    I apreciate your time.
    Thanks for any help.

    and the directory where i keep the servlet class is
    Tomcat41\webapps\ROOT\se\WEB-INF\servletOthers have pointed out that "servlet" should be "classes", but there is another mistake that hasn't been spotted. If you want your servlet to appear in the root context, you should use:
    Tomcat41\webapps\ROOT\WEB-INF\classes
    If you want your servlet to appear under the /se context, then you should use:
    Tomcat41\webapps\se\WEB-INF\classes
    and also, in the latter case, your form action should be /se/myGroupRegistration.

  • JDev 10.1.3 compile error in servlet 2.4 web.xml

    I built a Servlet 2.4/JSP 2.0 application in JDev 10.1.3. When I try to make/compile/deploy it the compiler gives me errors like the following for every JSP file that has a JSTL 1.1 taglib:
    Error(2,9): Element "web-app' used but not declared
    Error(2,63): Attribute 'xmlns:xsi' used but not declared
    Error(3,103): Attribute 'xsi:schemaLocation' used but not declared
    Error(4,16): Attribute 'version' used but not declared
    Error(4,56): Attribute 'xmlns' used but not declared
    Error(4,57): Can not build schema 'http://java.sun.com/xml/ns/j2ee' located at 'http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd'
    Error(5,15): Element 'description used but not declared
    It is obviously havng problems with the web.xml file (which is in the servlet 2.4 format) and is probably not finding the web.xml DTD document. How do I fix it?
    Installation is on Solaris 9 using J2SDK 1.4.2_04-b05
    By the way, this system is on a disconnected network. How do I get JDeveloper updates for a system not connected to the Internet?

    Allen,
    A JSP with web.xml web-app element
    <web-app 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" xmlns="http://java.sun.com/xml/ns/j2ee">
    runs in JDeveloper 10.1.3
    thanks,
    Deepak

  • Critical: Adding session-config to web.xml cause application NOT to start

    I added the <session-config> element under <web-app> in web.xml:
    <session-config>
    <session-timeout>30</session-timeout>
    </session-config>
    Now the app won't start!
    The reason: the built-in sun app server removes context-root attribute from <web-module> element in domain.xml when the app tries to start!
    Please fix this ASAP, guys!

    I placed it in the wrong place. After following the instructions contained in the Technical FAQ (below), it worked.
    Add the following element in your web.xml file, placing it after the mapping for the error servlet and before the welcome file list:
    <session-config>
    <!-- Set global default timeout to 60 minutes -->
    <session-timeout> 60 </session-timeout>
    </session-config>

Maybe you are looking for