Question on defining taglib in  web.xml

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

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

Similar Messages

  • Using taglib in web.xml in WLS 9.2

    I am trying to build a web application in which the JSPs refer to a JSF taglib at the following URI(http://java.sun.com/jsf/core). When i deploy the application in WLS 9.2 and attempt to load this JSP, WLS says that it is unable to resolve this taglib. I added the following to web.xml to help the application find the taglibs.
              <taglib>
              <taglib-uri>http://java.sun.com/jsf/core</taglib-uri>
              <taglib-location>
              /WEB-INF/jsf_core.tld
              </taglib-location>
              </taglib>
              But now when i attempt to startup WLS, it looks like the appserver does not recognize the <taglib> as a valid element. It gives the following exception:
              Expected elements 'description@http://java.sun.com/xml/ns/j2ee display-name@http://java.sun.com/xml/ns/j2ee
              instead of 'taglib@http://java.sun.com/xml/ns/j2ee' here in element web-app@http://java.sun.com/xml/ns/j2ee
              ..." VALIDATION PROBLEMS WERE FOUND"
              Any clues as to what i am doing wrong here since I have seen documentation which shows using taglib elements in web.xml.
              Thanks
              Ramdas

    I figured out looking at one of the webapp samples that is packaged as part of WLS9.2 that the taglib element needs to be part of the jsp-config element.
              -Ramdas

  • Reference taglibs in web.xml

    Hi,
    I'm trying to find a way to avoid having to always reference commonly used taglibs in all my jsps. Its kind of a hassle to manually change all references when the taglib.tld changes name.
    I looked at the <tag-lib> element for web.xml and am a little confused as to what purpose it serves. Does anyone know if this is suppose to provide the functionality I want or is used for earlier jsp specifications? Thanks.

    Which taglibs are you having trouble with that keep renaming their taglib.tld? Are they custom ones or standard ones available over the net?
    There are two methods of doing this, one by specifying a uri inside the taglib (like JSTL does) the second by setting up mappings in web.xml.
    The web.xml file can provide a mapping between the uri you specify in the jsp, and the actual tld file.
    So for example if you have in your jsp:
    <%@ taglib prefix="test" uri="http://my.testtag" %>in web.xml you would have the following:
      <taglib>
        <taglib-uri>/http://my.testtag</taglib-uri>
        <taglib-location>/WEB-INF/mytag.tld</taglib-location>
      </taglib>This sets up the mapping between the uri you used, and the actual tld on disk
    Now if the name of the tld file changes, all you do is change it in web.xml, and all your jsp pages will point at it.
    The better method IMO is to use the <uri> element in the tld file.
    For instance taking an example from JSTL 1.1 , c.tld
    <taglib>
    <uri>http://java.sun.com/jsp/jstl/core</uri>
    ...The c.tld file is bundled with the JSTL file standard.jar in the META-INF directory.
    This lets your jsp page just import the taglib with the uri, and the server will find it in the appropriate jar file. No need for any entries in web.xml to do this.
    If the tag library is written half-decently nowadays, they follow this pattern, and installing a new taglib becomes painless.
    Hope this helps,
    evnafets

  • Question about error-code in web.xml

    Can you use pattern matching for error-codes?
    Instead of
    <error-code>401</error-code>
    <error-code>403</error-code>
    <error-code>404</error-code>
    etc..
    you could just do
    <error-code>4*</error-code>

    I don't know a replacement for this, but I recommend to post this questione into Servlets section to get more chances for receiving answers...
    Regards,
    Mohammed Saleem

  • Define a context parameter not using web.xml

    Dears,
    With a web.xml file, it is possible to define a context parameter available in the web app via de ServetContext.getInitParameters method.
    Is it possible to define a context parameter not using the web.xml file ? Can I, in a java Class, init a custom context parameter ? (for exampel, init as a context param a key/value pair read from a property file).
    PS: the need is that the value (hmac key) currently define in the web.xml needs to be updated monthly. Apparently, under WebSphere (the app server we are using) changing the web.xml of the deployed app it not enought for it to be taken into account.
    Sincerely,
    Beno�t Bertrand

    Is it possible to define a context parameter not
    using the web.xml file ? Can I, in a java Class, init
    a custom context parameter ? (for exampel, init as a
    context param a key/value pair read from a property
    file).Does it necessarily have to be a value retrieved through the context param ? AFAIK, there's no way you could programatically 'set' an init param, which going by the name, 'init param' is quite understandable.
    You could define this value in a property file and read it in, in the init method. You should provide a mechanism to reload the new value after 'x' days. One approach is a Timer that does the job, do have a look at SteveJLuke's recommendations on the same in this thread
    http://forum.java.sun.com/thread.jspa?threadID=637355&tstart=0cheers,
    ram.

  • Tomcat web.xml "display-name" using flex.messaging.MessageBrokerServlet

           Hello,
    When my web application starts with the BlazeDS servlet flex.messaging.MessageBrokerServlet defined in the web.xml we have an error because in the display-name defined at top level in web.xml we have some text containing character ':'. The error is traced to inside the function
             flex.management.BaseControl.getObjectName()
    Which gets the object name, and this function calls
       BaseControl.getApplicationId()
    which finally calls
    ServletConfig.getServletContext().getServletContextName()
    This will return or display-name from the web.xml with all  it's text. This text contains among other characters the character ':'.  We use this tag for the display in the Tomcat Manager to see version  number and other of deployed project.
    After retrieving this name it is appended in the getObjectName() function to a buffer, this StringBuffer that already contains flex.runtime. and  now this name is appended (still with all that we are using for Tomcat  Manager with ':' character and other). After the name, other things are  appended. Our problem is that, after constructing this StringBuffer an instance of javax.management.ObjectName is created. In it's constructor it takes a String name  as input. This String is parsed in base of characters ':', '*', '?',  '\n' and so on, and since we have some of these characters in our  display-name it all goes wrong.
       My question is, if this is a bug, a limitation or if it is documented that using flex.messaging.MessageBrokerServlet we can not use certain characters in the display-name of the web.xml?
       Greetings, Tim
       We are using
    Tomcat 5.5.23
    Jdk 1.5.0_14
    blazeds-src-4.0.1.17657
    part of web.xml
         <display-name>
             Version: 1.10.0.3 (01/02/2011), Environment development, AGP:  10.220.6.8:1557/AGPSVI, AGP_STAGE: host 10.220.6.8:1557/AGPSVI
         </display-name>
         <description>IMPRESA progetto con undergroung</description>
         <listener>
             <listener-class>flex.messaging.HttpFlexSession</listener-class>
         </listener>
         <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>

    I have found that this is a bug and there is an issue open at the "Adobe Bug and Issue Management System", BLZ-617. I don't know if work is in progress, but when that issue is closed the problem will be solved.
      Greetings, Tim

  • Bug in lookup of web.xml env-entry in WL 7.0?

    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

    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

  • Struts web xml

    Hi there,
    I want to define my own error pages. Someone told me that it's possible to define them in web.xml
    I use this somewhere in my code:
    response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
    I want to keep this, but I want to make my own styled page.
    Can someone help me?

    in your web.xml for each error
    <error-page>
    <error-code>404 (500,...)</error-code>
    <location>anurlto your custom page </location>
    </error-page>

  • Edit web.xml programmatically

    And another question
    Can I edit the web.xml from the web application, in session been for example. I want the admin user to add roles from the web application page and grant them to users.
    Then it should be created automatically in the database
    and in web.xml.
    Maybe it is possible to add it in data base but not to web.xml.
    is there a way?
    Thank you, I hope to get answers soon from you.

    There probably are options to do this, but all of them(the ones i know of atleast), are either too cumbersome or an over-kill.
    Why do you want to add security roles/grants for "users" in your "web.xml" ? Apart from compromising security, I think your definitely going to violate some standard there.
    As a general note: In the end, all xml files are parsed and converted to beans. XML files merely are a place holder for convenience. If required you can figure out the bean holding this information and accordingly change the info it.
    Alternatively if you're still persistent in adding this security information on your web.xml the only plausible way i can think of is old-school. Get a file writer and add/edit this info. But this idea is too crazy to even suggest.
    Best suggestion: Design your application in such a way, so as to pick the info from a DB and accordingly handle.
    Cheers,
    K

  • Moving config stuff from myapp.conf in web.xml

    Hi guys,
    I made a web application myapp, which parse and read its config stuff from a text file called myapp.conf (a httpd.conf like file). I want to move all this config stuff in web.xml of my application (webapps/myapp/WEB-INF/web.xml).
    Can I do this?
    How can I read a tag with it's name, value, etc from web.xml?
    I put some env-entry tags in my web.xml but I don't know how to access them. Can you point me to some examples of doiing this?
    Thanks,
    bufny

    Hi,
    I can help u for the tomcat4.0 servlet engine:
    1)open the server.xml file availavle in the tomcat_home\
    config\ In that u add the context and can add the additional resource which can be later accessed from the jndi.Please refer the default file.
    2)then create the directory specified in the
    <context docbase="u r directory path" >
    resource can be added here
    </context>
    3) within that directory create the following structure:
    ur_dir\web-inf
    ur_dir\ web-inf\web.xml
    within the web-inf u specify something like this(Please refer default file)
    <res-ref-name>jdbc/demo</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    4)Then from ur jsp application within the same context
    call the usage as
    Context initCtx = new InitialContext();
    Context envCtx = (Context)initCtx.lookup("java:comp/env");
    DataSource d=(DataSource)envCtx.lookup("jdbc/demo");
    5)Similarly other objects can be accesses but need to be defined in the web.xml file (deploymentdescriptor)
    Hope u get some idea
    regards vicky

  • 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

  • Help with web.xml and deploying a servlet

    Hello,
    I've been tearing me hair out for the last few hours trying to get this to work... I've got a servlet org.fatbaob.servtest.Servtest that I want to deploy with Tomcat 4.0.4. It doesn't seem to mater what I put in the web.xml file I'm always getting 404 errors.
    The servlet is contained in a file c:\development\projects\servtest\WEB_INF\classes\org\fatboab\servtest\Servtest
    which mapped with a <context> tag in the Tomcat conf\server.xml file:
    <!-- Servtest context -->
         <Context path="/servtest" docBase="C:\development\projects\servtest" debug="0" privileged="true" reloadable="true">
         <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_servtest_log." suffix=".txt" timestamp="true"/>
    </Context>
    My web.xml file contains:
    <?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>
    <servlet>
    <servlet-name>ServTest</servlet-name>
    <servlet-class>org.fatboab.servtest.Servtest</servlet-class>
    </servlet>
    </web-app>
    Although I have tried putting in <servlet-mapping> tags, but they didn't seem to work either.
    My html file contains:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <title>Servlet Test</title>
    </head>
    <body>
    <h1>Servlet Test</h1>
    <form action="/servtest/servlet/org.fatboab.servtest.Servtest" method="post">
    <table>
    <tbody>
    <tr>
    <td>Name:</td>
    <td><input type="text" size="77" name="name" /></td>
    </tr>
    <tr>
    <td>Email:</td>
    <td><input type="text" size="77" name="email" /></td>
    </tr>
    <tr>
    <td colspan="2"><input type="submit" value="Submit" /></td>
    </tr>
    </tbody>
    </table>
    </form>
    </body>
    </html>
    The 404 error I get is:
    description The requested resource (/servtest/servlet/org.fatboab.servtest.Servtest) is not available.
    Help!
    Cheers,
    Bob.

    Hello,
    I've been tearing me hair out for the last few hours
    trying to get this to work... I've got a servlet
    org.fatbaob.servtest.Servtest that I want to deploy
    with Tomcat 4.0.4. It doesn't seem to mater what I put
    in the web.xml file I'm always getting 404 errors.
    The servlet is contained in a file
    c:\development\projects\servtest\WEB_INF\classes\org\fa
    boab\servtest\Servtest
    which mapped with a <context> tag in the Tomcat
    conf\server.xml file:
    <!-- Servtest context -->
    <Context path="/servtest"
    docBase="C:\development\projects\servtest" debug="0"
    privileged="true" reloadable="true">
    <Logger
    er className="org.apache.catalina.logger.FileLogger"
    prefix="localhost_servtest_log." suffix=".txt"
    timestamp="true"/>
    </Context>
    My web.xml file contains:
    <?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>
    <servlet>
    <servlet-name>ServTest</servlet-name>
    <servlet-class>org.fatboab.servtest.Servtest</servlet-
    lass>
    </servlet>
    </web-app>
    Although I have tried putting in <servlet-mapping>
    tags, but they didn't seem to work either.
    My html file contains:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
    xml:lang="en">
    <head>
    <title>Servlet Test</title>
    </head>
    <body>
    <h1>Servlet Test</h1>
    <form
    action="/servtest/servlet/org.fatboab.servtest.Servtest
    method="post">
    <table>
    <tbody>
    <tr>
    <td>Name:</td>
    <td><input type="text" size="77" name="name"
    ="name" /></td>
    </tr>
    <tr>
    <td>Email:</td>
    <td><input type="text" size="77" name="email"
    "email" /></td>
    </tr>
    <tr>
    <td colspan="2"><input type="submit"
    submit" value="Submit" /></td>
    </tr>
    </tbody>
    </table>
    </form>
    </body>
    </html>
    The 404 error I get is:
    description The requested resource
    (/servtest/servlet/org.fatboab.servtest.Servtest) is
    not available.
    Help!
    Cheers,
    Bob.Bob,
    Here an servlet definition I have defined in my web.xml...just plug in your values.
    <servlet>
    <servlet-name>AutoUpload</servlet-name>
    <servlet-class>com.lendleaserei.webservices.AutoUpload</servlet-class>
    <display-name></display-name>
    <description></description>
    </servlet>
    <servlet-mapping>
    <url-pattern>/webs</url-pattern>
    <servlet-name>com.lendleaserei.webservices.AutoUpload</servlet-name>
    </servlet-mapping>
    Hope this helps,
    Marco

  • Web.xml - adjusting the session configuration

    I recently applied SP07 for NW7.01 to one of our portals, and since doing this I can not find where to make adjustments for the session timeout. It used to be defined in the web.xml, does anyone know where it was moved to?
    I used to go here:
    /usr/sap/<SID>/JC##/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/web-inf/web.xml and adjust the default of 30 as necessary. Where is this value found now?
    I can also make the adjustment from the visual administrator under web container> properties> Session Timeout and this requries a restart of the web container service.
    From SAP HELP:
    Specifying HTTP Session Timeout 
    You can specify a timeout period for HTTP sessions created in your Web application. If the session is inactive for this timeout period, it is invalidated by the Web container.
    If you do not specify such a timeout explicitly, a default one of 30 minutes is assumed.
    You can configure the HTTP session timeout using the web.xml descriptor.
    Procedure
    On the web.xml screen, proceed as follows:
           1.      Open the General screen.
           2.      To specify the timeout period, enter a value in the Session configuration u2013 Session timeout field.
    The value is specified in minutes. If you enter a negative value in this field, HTTP sessions are never terminated because of a timeout. Instead, only an explicit logout by the user will terminate the corresponding session.

    Hello David.
    The help article is about custom development using NWDS. For adjusting session timeout system wide refer to Re: Portal session time out is 30 minutes.
    Best regards,
    Aliaksandr Zhukau

  • Access parameter from web.xml

    <servlet>
    <servlet-name>serverText</servlet-name>
    <servlet-class>abc</servlet-class>
    <init-param>
    <param-name>serverParam</param-name>
    <param-value>parameter</param-value>
    </init-param>
    </servlet>
    Hi, above is what i defined in my web.xml.
    i want to know how to get the serverParam from my jsp file.
    i tried to use String param = pageContext.getServletConfig().getInitParameter("serverParam");
    but i got null.
    please help me.
    thanks

    hi,
    well all jsps are compiled to servlets before running anyway, well if you using a jsp you can still do the
    String param = getInitParameter("serverParam");
    you could do this in the jspInit method
    public void jspInit()
    String param = config.getInitParameter("serverParam");
    // config is the implicit ServletConfig object
    The getInitParameter method is actually defined in the javax.servlet.ServletConfig class, the ServetConfig object is available as an implicit object by name config in a jsp page with page-level scope). well hope this was useful.
    Cheerz

  • 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

  • Host Parameter is null / Podcast submission

    Hi there! I'm starting a new podcast, in the hope that it will be avaliable via iTunes soon! but I hit a brick wall when I submitted my XML/rss feed to itunes and the following error message occured... "We had difficulty reading this feed. host param

  • Converting from PDF directly to Java Objects/XML (and PDF format questions)

    Hi, I posted this originally in the Acrobat Windows forums but was told I might have more luck here, so here goes: I am desperately trying to find a tool (preferably open source but commercial is fine also) that will sit on top of a PDF and allow me

  • My documents and pictures have been erased from one day to the next

    I've closed my macbook pro last thursday without shutting down, the next day when opening again all my documents and pictures have been erased from my files. I cannot find them anywhere, and they are also not in the recycle bin. Has anybody else had

  • Status 'Released'..

    Hi,   once SC status gets updated as 'RELEASED',means all approval approved the SC, will the status gets update in SC header table or is there any table using to find the SC Status..    the  requirement is i want to what are the SC gets approved ( re

  • Anyone know of a good bookkeeping program?

    I need a simple bookkeeping program. By simple, I mean printing invoices and keeping track of income and expenses. The idea here is to SAVE time. Quickbooks is a huge time waster - it's like a computer game for accountants or something. Three hours o