Do I must put ALL my servlets inside the web.xml file?

Hello everybody,
I am trying to migrate from Webshere to TOMCAT a project with severals packets, one of those have 15 servlets and some classes.
Is there any way to use the servlets without have to declare each one inside the web.xlm file ?
Thanks in advance.

All servlet definitions go into web.xml, though not the actual servlets themselves :) . Say if you wanted servlet A to have a different mapping you would define the mapping in web.xml to something other than the standard one.

Similar Messages

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

  • Servlet parameters in web.xml file

    Hi Guys
    What is ctx:dynamo: in web.xml why we have to use this one in servlet parameters
    Please give me a clear picture on this
    <init-param>
        <param-name>jumpServlet</param-name>
        <param-value>
          ctx:dynamo:/atg/dynamo/servlet/dafpipeline/JumpServlet
        </param-value>
      </init-param>

    Hi Guys
    What is ctx:dynamo: in web.xml why we have to use this one in servlet parameters
    Please give me a clear picture on this
    <init-param>
        <param-name>jumpServlet</param-name>
        <param-value>
          ctx:dynamo:/atg/dynamo/servlet/dafpipeline/JumpServlet
        </param-value>
      </init-param>

  • 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

  • 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

  • Configuring the web.xml to run Servlets

    Hi,
    Can i get some help to configure my web.xml file... ?
    I am trying to run servlets. Do i need to map each servlet i use or can i just create a folder and map the folder. Which web.xml file do i need to change... ? And under which directory shall i place the servlet folder.
    Thanks

    Hi,
    which server ur using ? if its tomcat then this can help u out..
    u have to change the web.xml file in ur own directory.
    for example u have ur directory in tomcat/webapps/<ur directory>
    then in ur directory u have to create 1 WEB-INF directory and copy the web.xml file in that. another thing u have to make 2 direcotries in WEB-INF.
    one is classes - u can keep ur servlets class files + ResourceProperty file
    second is lib - u can keep the library files here
    and u have to register ur each and every servlet in web.xml file
    take care
    enjoy the coading
    kedar

  • I put all my music in the recycle bin.  How do I get it back.

    I mistakenly put all my music in the recycle bin.  I have not emptied the recycle bin, so I know it's still there.  How do I get it back into iTunes?

    Right click on the recycle bin, select Restore.

  • I have just put all my albums in the cloud by accedent i dont know how to get it back on my laptop

    i have just put all my albums in the cloud by accedent i dont know how to get it back on my laptop

    Hey Niquenicole,
    I would follow the directions in here to download all your purchased music from iTunes:
    Downloading past purchases from the iTunes Store, App Store, and iBooks Store
    http://support.apple.com/kb/HT2519
    Welcome to Apple Support Communities!
    Best,
    Delgadoh

  • Do we need to put the following code in the web-xml for the project to run

    Hi^^^,
    actually I have created a project in Eclipse WTP and I am running it from remote server. Its giving me 404 error when I tried to run it.
    I know 404 error is generally due to some error in deployment descriptor.
    I am going through this tutorial for creating project in eclipse WTP
    this says that I need to include the following code in web-xml. Please look at the quotes below
    "Web modules in J2EE has a deployment descriptor where you configure the web application and its components. This deployment descriptors is called the web.xml. According to the J2EE specification, it must be located in the WEB-INF folder. web.xml must have definitions for the Servlet and the Servlet URI mapping. Enter the following lines into web.xml:"
    "Listing 2. Deployment Descriptor web.xml"
    <servlet>
    <servlet-name>Snoop Servlet</servlet-name>
    <servlet-class>org.eclipse.wtp.tutorial.SnoopServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Snoop Servlet</servlet-name>
    <url-pattern>/snoop/*</url-pattern>
    </servlet-mapping>
    My question is, it is necessary to include the above lines between <servlet> and </servlet-mapping> in web-xml
    thanks and regards,
    Prashant

    pksingh79 wrote:
    actually I have created a project in Eclipse WTP and I am running it from remote server. Its giving me 404 error when I tried to run it.
    I know 404 error is generally due to some error in deployment descriptor. what's the url you've put.
    <servlet>
    <servlet-name>Snoop Servlet</servlet-name>
    <servlet-class>org.eclipse.wtp.tutorial.SnoopServlet</servlet-class>
    </servlet> Every Servlet has to have a <servlet></Servlet> tag in the web.xml
    the <servlet-name>is for the naming the servlet and the <servlet-calss>is for class file of the servlet in your case the .class file is to be in the package of tutorial,if it's not then how the container will no where the calss file is
    <servlet-mapping>
    <servlet-name>Snoop Servlet</servlet-name>
    <url-pattern>/snoop/*</url-pattern>
    </servlet-mapping>You type something in your url likk http://localhost:8080/webappname (Tomcat server),so for url mapping instead of typing the entire class file name ,you just enough have to type what you've put in the <url-mapping> tag and it has to be inside of <servlet-mapping>
    I think the problem is in <url-pattern> change it like /snoop<url-pattern>
    My question is, it is necessary to include the above lines between <servlet> and ></servlet->mapping> in web.xmlSo now you think whether you need something inside <servlet>and </servlet-mapping>

  • JSP Servlet Mapping  in web.xml

    Hi!
    I have a JSP page by name "ContactUs.jsp" located in the folder <root>/jsp/info and I am using Tomcat Server. As I want to access this file using the URL "http://localhost:8080/<webapp>/ContactUs.jsp" instead of "http://localhost:8080/<webapp>/jsp/info/ContactUs.jsp". For this I added the follwing lines to web.xml file of my web app.
    <servlet>
    <servlet-name>org.apache.jsp.jsp.info.ContactUs_jsp</servlet-name>
    <servlet-class>org.apache.jsp.jsp.info.ContactUs_jsp</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>org.apache.jsp.jsp.info.ContactUs_jsp</servlet-name>
    <url-pattern>/ContactUs.jsp</url-pattern>
    </servlet-mapping>
    But I am getting the error saying that
    "ClassNotFoundException: org.apache.jsp.jsp.info.ContactUs_jsp"
    Is there any thing else to be modified? Please help me.
    Thanks in advance
    Geethanadh.K

    I'm no expert on this but I have a hunch. 1st of all, your using a servlet mapping for a JSP. That's good and well but it seems that the container is complaining that there is no servlet named org.apache.jsp.jsp.info.ContactUs_jsp. In other words it looks like the JSP has not been compiled. At least not yet. Maybe try two things. Visit the JSP once with a browser at it's actual path "http://localhost:8080/<webapp>/jsp/info/ContactUs.jsp" the coerce a page compile. Then try it with your new mapped path. You see, just telling the container that there is a servlet mapped to the new URL doesn't force the container to generate the class. Something or someone must generate the servlet class file.
    Honestly, I'm not sure of what your end goal is but maybe you might consider using a JSP pre-compiler? Or even better, register a servlet at the mapped path that fowards all requests into the desired folder.
    Cliff

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

  • Do Weblogic 5.1 support servlet 2,2 web.xml?

    Found that a lot of tags in web.xml according to Java servlet 2.2 API didn't work in Weblogic server 5.1, tags such as <session-mapping>, <session-timeout> didn't work at all. Is these tags didn't support in 5.1?
              

              Thank for your correction on the <servlet-mapping>, it is a typing error, it works
              after I correct it.
              But the <session-timout> tag still didn't work.
              I set it up as follow in my web.xml:
              <session-config>
              <session-timeout>30</session-timeout>
              </session-config>
              My testing servlet code as follows, it always shows a timeout value of 1800 seconds
              instead of my preset 30 seconds in the web.xml:
              public void doGet(HttpServletRequest request, HttpServletResponse response) throws
              ServletException, IOException {
                   HttpSession session = request.getSession();
                   response.setContentType("text/html");
                   OutputStreamWriter osw = new OutputStreamWriter(response.getOutputStream());
                   PrintWriter out = new PrintWriter (response.getOutputStream());
                   out.println("<html>");
                   out.println("<head><title>HelloWorld</title></head>");
                   out.println("<body>Hello From HelloWorld doGet()");
                   out.println("<P>Session will be timeout for " + session.getMaxInactiveInterval()
              + " secs.");
                   out.println("</body></html>");
                   out.close();
              Kumar Allamraju <[email protected]> wrote:
              ><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
              ><html>
              >Do you mean servlet mapping? I can't seem to find out session-mapping
              >in
              >the dtd
              ><br>Yes we do support session-timeout in 5.1
              ><br>see http://www.weblogic.com/docs51/classdocs/webappguide.html
              ><p>--
              ><br>Kumar
              ><p>Alfred Leung wrote:
              ><blockquote TYPE=CITE>Found that a lot of tags in web.xml according to
              >Java servlet 2.2 API didn't work in Weblogic server 5.1, tags such as
              ><session-mapping>,
              ><session-timeout> didn't work at all. Is these tags didn't support
              >in
              >5.1?</blockquote>
              ></html>
              >
              

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

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

Maybe you are looking for