How should my web.xml be ?

Hi,
I have a servlet application. In my application, I make a call to my servlet through my index.html as follows:
<Form Action="/greeting/servlet/GreetingServlet" method="POST">
I also pass the values "name" and "email" through index.html
I have my servlet located at "D:\Amith\Servlet Applications\greeting\WEB-INF\classes"
I have added following lines in my server.xml
<Context path="/greeting" docBase="D:\Amith\Servlet Applications\greeting">
</Context>
The application runs fine with Tomcat 3.3.2 without web.xml
But when i try to run the application with Tomcat 5.0.24, I get the error
"HTTP Status 404 - /greeting/servlet/GreetingServlet"
Can anyone help me with this. Should i have web.xml for this. If yes, how should my web.xml be ?
Please help, I am unable to solve this problem from a very long time. I am really struck !!!
Thanks,
ammi

<web-app xmlns = "http://java.sun.com/xml/ns/j2ee" version = "2.4">
<servlet>
     <servlet-name>GreetingServlet</servlet-name>
     <servlet-class>project.image.DynamicImageServlet</servlet-class>
</servlet>
<servlet-mapping>
     <servlet-name>GreetingServlet</servlet-name>
     <url-pattern>/greeting/servlet/GreetingServlet</url-pattern>
</servlet-mapping>
</web-app>the servlet-class tag should contain the package where your servlet .class file is held. Just omit my one

Similar Messages

  • How to generate web.xml automatically?

    Hi all!
    I am new to servlets. I have configured the tomcat 5.5.9 with eclipse 3.0 succussfully. It is generating the class files. But I want to know how to generate web.xml through it.
    Thanks in advance...
    Code Snooker

    AFAIK, there's no template for generating web.xml.
    Navigate to <TomcatInstallDir>/webapps/
    You would find lot of directories - each one being a web application.
    Navigate to any one, say ROOT and then to the WEB-INF directory
    under that.
    You would find a web.xml.
    Copy it into your <web-application-dir>/WEB-INF folder and make necessary changes
    cheers,
    ram.

  • How to deploy web.xml in OAF to server?

    Hello,
    Currently i used oracle 9i jeveloper to develop OAF page for EBS 11.5.10
    based on requirement, i need create a new JSP file and change default web.xml file in jeveloper. Who can help how to deploy new web.xml to server? Thank you very much!
    Added following code to web.xml
    ---web.xml------------
    <servlet>
    <servlet-name>barbecue</servlet-name>
    <servlet-class>net.sourceforge.barbecue.BarcodeServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>barbecue</servlet-name>
    <url-pattern>/CreateBarCode</url-pattern>
    </servlet-mapping>
    -----------------------------------

    Anyone know how to deploy web.xml in local jeveloper to server? thanks a lot!

  • How to reupdate web.xml

              hi,
              I downloaded WLS 6.0, W2K for testing.
              Whenever I updated web.xml for my new servlets, I need to stop and restart weblogic
              server.
              Is there any way for weblogic to detect that web.xml had changed and updated accordingly
              or command line to trigger update in web.xml?
              thanks.
              - yoke
              

              An application or application component can be dynamically redeployed while the server is running. This may be useful if you want to update a deployed application or application component without stopping and restarting the WebLogic Administration Server. To dynamically redeploy a JAR, WAR or EAR file, simply copy the new version of the file over the existing file in the /applications directory.
              You can also dynamically redeploy applications or application components that have been deployed in exploded format. When an application has been deployed in exploded format, the Administration Server periodically looks for a file named REDEPLOY in the exploded application directory. If the timestamp on this file changes, the Administration Server redeploys the exploded directory.
              If you want to update files in an exploded application directory, do the following:
              1. When you first deploy the exploded application, create an empty file named REDEPLOY in the directory where the exploded application resides.
              2. To update the exploded application, copy the updated files over the existing files in that directory.
              3. After copying the new files, touch the REDEPLOY file in the exploded directory to alter its timestamp.
              When the Administration Server detects the changed timestamp, it redeploys the contents of the exploded directory.
              yoke <[email protected]> wrote:
              > thanks for the doc link.
              > In figure 6.1, it said that I should be able to see the "Configuration->application".
              > However, I had only see the following tabs under configuration:
              > General, Cluster, HTTP, SSL, Tuninh, Protocols, Compilers.
              > I don't have "application" tab, how can I bring out the application tab?
              > thanks.
              > - yoke
              > Dimitri Rakitine <[email protected]> wrote:
              >>http://e-docs.bea.com/wls/docs60/adminguide/appman.html#1027432
              >>
              >>yoke <[email protected]> wrote:
              >>
              >>> hi,
              >>
              >>> I downloaded WLS 6.0, W2K for testing.
              >>> Whenever I updated web.xml for my new servlets, I need to stop and
              >>restart weblogic
              >>> server.
              >>
              >>> Is there any way for weblogic to detect that web.xml had changed and
              >>updated accordingly
              >>> or command line to trigger update in web.xml?
              >>
              >>> thanks.
              >>
              >>> - yoke
              >>
              >>
              >>--
              >>Dimitri
              Dimitri
              

  • Re: how to recover web.xml after editing by word?

    Do you seriously think that there's a way to reconstruct the full XML from these tiny pieces of information? One can guess, but it builds down to re-writing the web.xml
    Your best bet is to get the last version of that file from your [version control system|http://en.wikipedia.org/wiki/Revision_control]. You surely use one, right? And if you don't, then you now know why you should be using one.

    xzeng wrote:
    Thanks. Fortunately I got a web.xml with similar format from other's folder.
    It is terrible. All the tabs in web.xml are missing and changed into microsoft word's tabs. Be careful.We are. We would never ever ever use Word as a text editor and we use a version control system.

  • How to setup web.xml files in Tomcat 4.0.6

    Hi, I'm to new to Java Servlets. i am trying to run my first servlet but it's not showing up..can anyone help me out please!!!
    I created a folders like this:
    webapps/sumitapps/WEB-INF\classes\Forms\login.class
    under sumitapps: i'm puttin all of my .html files(Logins.html)
    under WEB-INF: i put web.xml file and classes folder
    <?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>login</servlet-name>
    <servlet-class>Forms.login</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>login</servlet-name>
    <url-pattern>/Forms.login</url-pattern>
    </servlet-mapping>
    </web-app>
    <Context path="/sumitapps" docBase="webapps/sumitapps" crossContext="true" debug="0" reloadable="true" trusted="false" >
    </Context>
    under my classes folder i put folder Forms where i'm keeping all of my .class files. my class file name is login.class
    can anyone tell me why i cant run my servlets
    <FORM method="POST" action="Forms.login"
    name=userinfo onsubmit="return checkData()">
    please help me out here
    i can access my html page like this:
    http://lcoalhost:8080/sumitapps/Logins.html
    but when i enter userid and password it doesnt show anything..it takes me to http://localhost:8080/sumitapps/Forms.login
    and shows cannot be displayed

    have a look at www.moreservlets.com. There you can find a free pdf (part of the book, a whole chapter) that explains in deep the use of web.xml.

  • How to transport web xml content in portal

    Hi Everyone,
    I have created web xml content in my dev portal which has user messages.Now i wanr to transport all these to QA portal.i have transported all the content using KM content transport procedure. i even transported /etc/xmlforms.
    now if i check in QA portal i can see all the message links but when i click these links,a window pops up with XML code of that particular form instead of that message.
    Is there anything which i have forgotten or which needs to be done.
    Please do the needful.
    Thanks and Regards,
    Atul Dumbre.

    Hi Mikhail,
    Thanx a ton for your reply.
    My problem has been solved and now i can see all the web xml forom content in my QA Portal.
    But now my problem is that when i edit or create new message in my QA Portal it doesnt reflect in my User message area or in the messages list.
    Could you please help me out with that
    Thanks and Regards,
    Atul Dumbre
    Edited by: AtulDumbre on Jun 8, 2011 7:47 AM

  • How to edit web.xml deployment descriptor from console in weblogic 8.1?

    In weblogic 7.0, deployment descriptor such as web.xml can be edited from the admin
    console, but on weblogic 8.1 I can't find a way to do so.
    Is this function taken out? Why is it taken out? Do I have an alternative to edit
    it without unpacking and packing the EAR or WAR?
    Thanks in advance.
    Bill

    In weblogic 7.0, deployment descriptor such as web.xml can be edited from the admin
    console, but on weblogic 8.1 I can't find a way to do so.
    Is this function taken out? Why is it taken out? Do I have an alternative to edit
    it without unpacking and packing the EAR or WAR?
    Thanks in advance.
    Bill

  • How to modify web.xml init parameters?

    Hi all!
    I need to modify my application's init parameters on the fly.
    I think that if i can get those parameter through FacesContext, then i should can set them too.
    Anybody knows if it is possible ou how to do it?
    Thanks,
    Cezar

    Hi all!
    I need to modify my application's init parameters on the fly.
    I think that if i can get those parameter through FacesContext, then i should can set them too.
    Anybody knows if it is possible ou how to do it?
    Thanks,
    Cezar

  • Configuring web.xml for OpenSSO

    Hello!
    I am developing simple web application and want to use opensso in my web application.I have downloaded opensso,deployed and configured ,so i dont need how to configure web.xml ,what filters and jars i needed,i have the simple web.xml
    <web-app>
         <security-constraint>
              <web-resource-collection>
                   <web-resource-name>admin</web-resource-name>
                   <url-pattern>/admin/*</url-pattern>
              </web-resource-collection>
              <auth-constraint>
                   <role-name>admin</role-name>
              </auth-constraint>
         </security-constraint>
         <login-config>
              <auth-method>FORM</auth-method>
              <form-login-config>
                   <form-login-page>/login.jsp</form-login-page>
                   <form-error-page>/error.jsp</form-error-page>
              </form-login-config>
         </login-config>
         <security-role>
              <role-name>admin</role-name>
         </security-role>
    </web-app>so what filter should i add in web.xml so that when i access admins page <url-pattern>/admin/*</url-pattern>it should redirect to opensso s login page?

    Yes, I restarted the app server after making changes to web.xml file. No effects.

  • What is web.xml and why it is used?

    hi,
    am new to servlet technology, i tried to find a topic like this in this fourm also in google but didn't get a exact one. can anybody explain me or suggest me some resource about this.
    thanx in advance.
    Max

    hi stevejluke,
    thanx for the correct link.
    nx for the correct link. but what i in doubt with is
    why we should use web.xml? may be my question is very
    silly, may be too basic, forgive me for that...
    Thanx & Regards,
    SaikatAt the most basic level:
    There are several versions of the Servlet specification, You need the web.xml to tell the server which version of the spec your application conforms to so the server knows how to deal with different things.
    If you have a servlet, you also need the web.xml to define what URL signals a request that should be handled by your servlet.
    At this point, you need to sit down and read a book. Do what it says, blindly at first. Just do what it says (but do try to understand the 'what' of it, just don't question the 'why'). After you have a few applications running, go back and ask yourself this question again and try to see what you are using the web.xml for in those applications you have.

  • Web.xml

    Please let me where to put web.xml in Oracle Application Server and how to deploy an application in Application server.

    Debu,
    We are not using OC4J. We are using apache for our application. We are placed our web.xml in Web-inf folder. But we are unable to get parameters or other functionality using web.xml. Can you tell me how to handle web.xml in this case.
    Thanks
    Sudha

  • Web.xml in tomcat

    hi all,
    i'm using Tomcat as a server.i don't know how to use web.xml.i don't want to change values in my servlets.i want to change values thru web.xml.i don't know the procedure to read values from web.xml toservlets.if any body knows let me know.
    Thanks in advance

    All you have to do is add parameters to the <init-param> section for you servlet. Then you can read it in using the getInitParameter( name ) method in the servlet. For example I'm reading in a configuration file for my servlet so I added it to the web.xml. Then in my servlet I just do the following to get my configuration file location:
    String config = getInitParameter( "configFile" );
    This is my entry in web.xml file:
    <servlet>
    <servlet-name>
    MyServlet
    </servlet-name>
    <servlet-class>
    com.xxxx.controller.MyServlet
    </servlet-class>
    <init-param>
    <param-name>configFile</param-name>
    <param-value>
    /jakarta-tomcat-3.2.2/htdocs/WEB-INF/init.conf
    </param-value>
    </init-param>
    <load-on-startup>
    5
    </load-on-startup>
    </servlet>
    MyServlet
    Hope this helps

  • How to read configuration data from an xml file (not web.xml)?

    Hi,
    I want to separate the application specific configuration parameters in a separate xml file and read them as and when they are needed? I know that I can use the wb.xml but I want to separate them in a different xml file because I don't want the web.xml file to be played around later after deployment. If any change is needed then it should be done in the application-config.xml.
    How can I read the parameters from this xml file in my jsp code and also what should be the location of this file if I have
    ../webapps/Root/application
    directoty structure ?
    Any help is greatly appreciated.

    can you give an example of a property file and also
    it is loaded in the jsp ?Hmm... loading properties in a JSP is not a very good idea. You should do it in a separate class, rather than mixing the logic with the display logic.
    Properties properties = new Properties();
    properties.load(UtilClass.class.getResourceAsStream("config.properties"));
    // Add a try - catch block around the load
    // for IOException...

  • How to send a xml to a web service

    Hi All
    I've generated a xml report that I need to send to a web site that I could imagine have a web service to receive the report.
    The question is: how should I send my xml file ??
    I've tried to find docs about it but there are a lot of complex examples and I need to do just this simple job...
    Any idea, example or help will be appreciated...
    Thanks in advance
    <jl>

    You can do anything as simple as a socket all the way up to using a web services protocol like SOAP.
    - Saish
    "My karma ran over your dogma." - Anon

Maybe you are looking for

  • Condition Types In pricing

    Hi, While creating new condition types in pricing, we create them by copying them from exsting condition types. So while doing this which reference condition types should we select for copying new one?

  • Document flow

    Dear All, Can anyone suggest how, based on a list of sales orders i will be able to query to see the corresponding delivery numbers and invoice numbers? Is there some way predefined in SAP? i just want to plug in the order numbers and geta  report sh

  • Extracting data from flat file in OWB

    Hi, Does anyone know, how to run a mapping having source as flat file in OWB? I am facing a problem as run button becomes disabled as it is SQL Loader script. When I register the TCL script with OEM it doesn't pass the name of the CTL file as paramet

  • Elements 10 out of bounds extension tool don't work*help

    new to this and was doing well till got to this stage clicked on extension tool and all I get is a hand don't know what I am doing wrong

  • Spotlight giving multiple & odd results for Apps

    Hello folks- My Spotlight is giving me multiple & odd Application results for the same app. Screenshots for iCal search: http://dl.dropbox.com/u/567698/Screen%20shot%202010-01-02%20at%205.58.48%20PM.pn g http://dl.dropbox.com/u/567698/Screen%20shot%2