Calling a servlet in java class

Hello,
I try to call a servlet from java class
but is dose not work
what should be the problem
   public void callServlet()
          try
                        // xxservlet is the servlet name
               URL url = new URL("http://www.mydomain.com/xxservlet");
               URLConnection hpCon = url.openConnection();
               hpCon.setDoOutput(true);
               OutputStreamWriter out = new OutputStreamWriter(hpCon.getOutputStream());
               out.write("This Is a Test");
               out.flush();
               out.close();
          }catch(Exception ex){ex.printStackTrace();}     
// My Servlet  is in package servlets
public class XXServlet extends HttpServlet
    public void service(HttpServletRequest req, HttpServletResponse resp) {
        try {
             ServletInputStream sin = req.getInputStream();
             int len = req.getContentLength();
                byte[] input = new byte[len];
                ServletInputStream sin = req.getInputStream();
               int c, count = 0 ;
               while ((c = sin.read(input, count, input.length-count)) != -1) {
                   count +=c;
              sin.close();
              String inString = new String(input);
              System.out.println("Servlet is running ...."+inString);
        } catch (IOException e) {
            try{
                resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
                resp.getWriter().print(e.getMessage());
                resp.getWriter().close();
            } catch (IOException ioe) {
// web.xml
<servlet>
       <servlet-name>xxservlet</servlet-name>
       <servlet-class>servlets.XXServlet</servlet-class>
    </servlet>
   <servlet-mapping>
    <servlet-name>xxservlet</servlet-name>
    <url-pattern>/xxservlet</url-pattern>
  </servlet-mapping>
}regards
Edited by: the_Orient on Mar 30, 2009 3:16 AM

I have start servlet from brwoser only to test that servlet works fine
A gain what I need
I want to call a servlet from a javs class
URL url = new URL("http://www.mydomain.com/myservlet");
  URLConnection hpCon = url.openConnection();
  hpCon.setDoOutput(true);
  OutputStreamWriter out = new OutputStreamWriter(hpCon.getOutputStream());
  out.write("Hello Woprld");
  out.flush();
  out.close();// Servlet
public void doGet(HttpServletRequest req, HttpServletResponse resp) {
        try {
              String xp =req.getSession().getServletContext().getRealPath("/");
              File f = new File(xp+"/students/info.txt");
              f.createNewFile();
        } catch (IOException e) {
            try{
                resp.setStatus(HttpServletResponse.SC_BAD_REQUEST);
                resp.getWriter().print(e.getMessage());
                resp.getWriter().close();
            } catch (IOException ioe) {
problem file can not be created
    public void doPost(HttpServletRequest req, HttpServletResponse resp)
}I hope that is clear

Similar Messages

  • Calling Servlet from Java Class in eclipse

    Hi ,
    I am calling a Servlet from JAVA Class as I am using IDE: Eclipse. The Problem is below
    URL url = new URL(ServletPath);
    URLConnection connet = url.openConnection();
    I am using the above code in JAVA to Connect to Servlet I have given Print statement in Servlet such that whenever it calls it prints on Console but when I try to run the code the Statement is not printed in the Console of eclipse I think URL connection is not able to establish any connection ..... if any has solution for this please reply
    Thanks & Regards,
    Arvind

    I am calling a Servlet from JAVA Class as I am using IDE: Eclipse. The Problem is below
    URL url = new URL(ServletPath);
    URLConnection connet = url.openConnection();Why should the Servlet running in different Runtime print on your Eclipse Runtime. Please be more clear about the question.

  • How to call a servlet  by  java standalone application

    //program related to calling a servlet by java standalone application and printing the response on console
    import java.io.*;
    import java.util.*;
    import java.lang.Object;
    import java.net.*;
    public class Program
         public static void main(String s[])
         System.out.println("Hello this programm defines about how to call a servlet with a java application ");
         try{
              URL servlet = new URL("http://localhost:8080/anchor/studentform.html");
              URLConnection conn=servlet.openConnection();
              conn.setDoOutput(true);
              InputStreamReader isr=new InputStreamReader(conn.getInputStream());
              BufferedReader br = new BufferedReader(isr);
              String str =br.readLine();
              System.out.println("Source code is" +str);          
         catch(IOException e)
         System.out.println("exception is" +e);
    i am able to read only one line of the form, please help me out to read the whole form (file)

    You are only reading one line? Why aren't you reading the data in a loop? E.g. a while loop. (Keep reading till readLine returns null)
    Kaj

  • Calling a servlet from java

    How to call a servlet from java?
    your help is greatly appreciated..

    Welcome to the forum
    You seem to be misunderstanding something. Do some googling to learn what you need about servlets. Simplified, servlets are java code that's hosted by a web container, such as Tomcat. When a servlet gets called as a consequence of someone requesting a url from the container, it takes in a request object and a response object. All the magic is then in creating an appropriate response (e.g. html) for the incoming request.

  • JSP, Servlet, and Java Classes location in Tomcat

    In tomcat, I want to know JSP files, Servlets, and Java classes
    should put in different locations:
    I put web.xml in the following:
    C:\jakarta-tomcat-4.1.30\webapps\proj1\WEB-INF
    I put all JSP files in the following:
    C:\jakarta-tomcat-4.1.30\webapps\proj1
    I put all servlet files in the following:
    C:\jakarta-tomcat-4.1.30\webapps\proj1\WEB-INF\classes
    I put all Java classes in the following with package proj1:
    C:\jakarta-tomcat-4.1.30\webapps\proj1\WEB-INF\classes\proj1
    When I execute JSP files, it has HTTP error 404, file not found.
    The content of web.xml is:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <display-name>proj1</display-name>
    <description>
         proj1
    </description>
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/*</url-pattern>
    </servlet-mapping>
    </web-app>
    Please advise. thanks!!!

    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/*</url-pattern>
    </servlet-mapping>
    </web-app>Where's the servlet definition that maps to "invoker"?

  • Deploying the JSPs, Servlets and Java class files

    Hello All,
    I'm very new to the Oracle 9i AS. We are using Version 1.0.2.2.
    How do we deploy the JSPs, Servlets, and Java class files (simple class files, not EJBs)?
    plese give us the procedure and stpes how to deply or the links for the same.
    Thanks,
    Santhosh.

    Hi
    I guess u r running apache-jserv as servlet engine for your jsp and servlets. If its so, jsp files can be run without any additonal configuration by putting the jsp file under document root or any subdirectory and for running servlets u have to add classpath entries for your servlet in jserv.properties file.
    To make sure that your servlet engine is working, try
    http://servername:port/servlet/IsItWorking, if u get success msg that means servlet engine is working fine.
    Hope this will help
    Regards
    Kumaran

  • Calling Servlet from Java-Class

    Hi,
    I have a normal java-class that is working with request/response Objects. From within this class I want to call a local servlet, let it do some work with the request and the response and then return it to the class.
    I guess the RequestDispatcher can only be called from within a Servlet, but my class is not a servlet.
    The getServlet()-method is not working any more.
    Maybe somebody has an idea.
    Thanks a lot,
    Matthias

    Hi,
    I have a normal java-class that is working with
    request/response Objects. From within this class I
    want to call a local servlet, let it do some work with
    the request and the response and then return it to the
    class.
    I guess the RequestDispatcher can only be called from
    within a Servlet, but my class is not a servlet.
    The getServlet()-method is not working any more.
    Maybe somebody has an idea.
    Thanks a lot,
    MatthiasThis is not very pretty, so I think you should redessign, but you can open a URLConnection from your class pointing to the URL of the servlet. As far as I know you can't invoke a servlet directly, because you can't get a reference to it, it can only be invoked by the container...

  • Call Bean from normal java class

    Dear Friends,
    Is it ok to call an entity bean or session bean frm normal Java class.
    (Java class is in the same application as the beans).
    Is there a special way to lookup the beans from normal java classes.
    Thanking You,
    Chamal.

    it is ok and very commonly done.
    Note that the simple java program must be running in the same local network. You cannot have the java program and EJBs distributed over internet. (I m not certain of it, but mostly I shoudl be correct. If you have the resources, try it out and let me know)
    In most of the cases, EJBs are called by
    1. A servlet
    2. Another EJB
    3. a simple java program.
    In the first 2 cases, you can go for Local Interfaces (more so in the second case than the first). The reason being that the the client and server will be in the same JVM (typically the Application server). Thus, in the first case, if the Web container and the ejb container are in the same app server, EJBs can be local.
    However, in the third case, it is unlikey that you will have the client runnng and the same jvm as the server, because the app server has its own jvm.
    sample code (this method is being called from the main method of a simple java program. it is self explanatory):
    public  void processRequestForSessionBean()
             System.out.println("REQUEST RECEIVED");
             try
                   Hashtable nameHashtable = new Hashtable();
                   nameHashtable.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );
                   nameHashtable.put( Context.PROVIDER_URL, "t3://localhost:7001" );
                   InitialContext context = new InitialContext(nameHashtable);
                   System.out.println("created initial context");
                   Object lookupObject = context.lookup("CustomerBean");
                   System.out.println("Got the lookup object");
                   CustomerDataHome home = (CustomerDataHome) PortableRemoteObject.narrow(lookupObject,
                             Class.forName("com.shiv.business.CustomerDataHome"));
                   System.out.println("Home interface");
                   customerData = home.create();
                   System.out.println("Remote Interface");
                   addDataToSB(customerData);
                   ArrayList namesList = customerData.getNames();
                   System.out.println(namesList.toString());
                   //customerData.remove();             
              catch (Exception exception)
                   System.out.println("FATAL ERRORS");
                   exception.printStackTrace();
              }

  • How to get caller principal in a Java class?

    I understand if I implement the web service with an EJB, I should be able to get
    the caller's principal using EJBContext. How do I get the caller's principal if
    I implement a web service with WL70 using a Java class?
    Thanks,
    - Hao

    Bruce, thank you for your response.
    However, the getCurrentUser() method does not seem to work. It throws an exception
    but I couldn't see what exception it throws. The documention also says that class
    and its methods are deprecated.
    Is there any other Weblobic class that is doing similar thing?
    - Hao
    "bruce leroy" <[email protected]> wrote:
    >
    i think you could use the getcurrentuser method
    http://e-docs.bea.com/wls/docs70/javadocs/weblogic/security/acl/Security.html#getCurrentUser()
    "Hao" <[email protected]> wrote:
    I understand if I implement the web service with an EJB, I should be
    able to get
    the caller's principal using EJBContext. How do I get the caller's principal
    if
    I implement a web service with WL70 using a Java class?
    Thanks,
    - Hao

  • Problem accessing servlet from java class which uses Basic Authentication

    "Hi,
    I am using weblogic 6.1 server. I am calling a servlet file from a class file using HttpURLConnection. This is the code below.
              String theUsername="B1A1Z1T2";
              String thePassword="hlladmin";
              String urlString="http://rsnetserver:113/hll/servlet/CallSSRUpload";
              String userPassword = theUsername ":" thePassword;
              String encoding = new sun.misc.BASE64Encoder().encode (userPassword.getBytes());
              try
                   URL url = new URL (urlString);
                   HttpURLConnection uc=(HttpURLConnection)url.openConnection();
                   int it = 0;
                   while ((it = encoding.indexOf('\n')) != -1
                        || (it = encoding.indexOf('\r')) != -1) {
                             encoding = encoding.substring(0, it)
                             encoding.substring(it 1);
                   uc.setRequestProperty("Authorization","BASIC " encoding);
                   uc.setRequestProperty("SOAPAction", url.toString());
                   System.out.println(uc.getResponseCode());
                   System.out.println(uc.getResponseMessage());
              catch(Exception io)
                   io.printStackTrace();
                   System.out.println("error message........" io.getMessage());     
    In web.xml I have d

    Hello,
    Could you post the stack trace?
    Thanks,
    Bruce
    Vijay Babu wrote:
    >
    "Hi,
    I am using weblogic 6.1 server. I am calling a servlet file from a class file using HttpURLConnection. This is the code below.
    String theUsername="B1A1Z1T2";
    String thePassword="hlladmin";
    String urlString="http://rsnetserver:113/hll/servlet/CallSSRUpload";
    String userPassword = theUsername ":" thePassword;
    String encoding = new sun.misc.BASE64Encoder().encode (userPassword.getBytes());
    try
    URL url = new URL (urlString);
    HttpURLConnection uc=(HttpURLConnection)url.openConnection();
    int it = 0;
    while ((it = encoding.indexOf('\n')) != -1
    || (it = encoding.indexOf('\r')) != -1) {
    encoding = encoding.substring(0, it)
    encoding.substring(it 1);
    uc.setRequestProperty("Authorization","BASIC " encoding);
    uc.setRequestProperty("SOAPAction", url.toString());
    System.out.println(uc.getResponseCode());
    System.out.println(uc.getResponseMessage());
    catch(Exception io)
    io.printStackTrace();
    System.out.println("error message........" io.getMessage());
    In web.xml I have d

  • How to call JCS in simple java class

    I want to make a atsratup class and this class will have to communicate with a
    java controls.But i am not able to create an instance of java control in simple
    startup class.
    IF any body has called java control in simple java class pls. let me know

    Hi Surinder,
    you can use (some types of) controls with the following code:
    Class controlClass = Class.forName("mypackage.MyControl");
    MyControl control = (MyControl)WlwProxy.create(controlClass, request);
    control.callMethod();
    Unfortunatelly it requires a request (or an URL), so you will need some
    tricks to use it in a startup class.
    This is an internal, undocumneted... call and does not set any
    parameters of the control, so use it with care.
    Let me know if you can solve your problem, pls
    BR,
    don
    surinder wrote:
    I want to make a startup class and this class will have to communicate with a java
    controls.But i am not able to create an instance of java control in simple startup
    class.
    IF any body has called java control in simple java class pls. let me know
    "surinder" <[email protected]> wrote:
    I want to make a atsratup class and this class will have to communicate
    with a
    java controls.But i am not able to create an instance of java control
    in simple
    startup class.
    IF any body has called java control in simple java class pls. let me
    know

  • Insert/flag data to PV9 (db) with CVP script (Call Studio) and create java class

    Hi all,
    i already created workflow with CVP script using Call studio, i have a problem how to insert call entered digit to PV9 and check the bill customerID with java class.
    The workFlow design:
    1. Customer enter the customerID (sessionID from ICM)
    2. Play the customerID ---> Insert to PV9 (ex: 12390)
    3. Check monthly bill
    4. Option enter another customerID
    5. Back to step 2 ---> Insert to PV9 (ex:12390,12380)
    When we want to create a java class is enough to install default call studio + JDK and create new call studio project? because when i created new call studio project only will be created callflow folder and app.callflow
    thx before,
    darma

    Hi Chintan,
    This'is my callflow design with callStudio
    i want create java class to get value from REST Url, i already have the script but i'm still confused how to deploy it in call studio, my call studio project is like this
    this'is the java source, how to compile and what prerequisites are required?
    /*   1:    */ import com.audium.server.AudiumException;
    /*   2:    */ import com.audium.server.session.ActionElementData;
    /*   3:    */ import com.audium.server.voiceElement.ActionElementBase;
    /*   4:    */ import java.io.BufferedReader;
    /*   5:    */ import java.io.InputStreamReader;
    /*   6:    */ import java.io.PrintStream;
    /*   7:    */ import java.net.URL;
    /*   8:    */ import java.net.URLConnection;
    /*   9:    */ 
    /*  10:    */ public class MyBill
    /*  11:    */   extends ActionElementBase
    /*  12:    */ {
    /*  13:    */   static final int PREDICT_THRESHOLD = 3;
    /*  14:    */   private static String vBill;
    /*  15:    */   
    /*  16:    */   public static void GetDataBill(String strDataBill)
    /*  17:    */     throws Exception
    /*  18:    */   {
    /*  19: 23 */     vBill = "0";
    /*  20:    */     
    /*  21: 25 */     URL strBill = new URL("http://192.168.10.23//wsclient.php?id=" + strDataBill);
    /*  22:    */     
    /*  23:    */ 
    /*  24:    */ 
    /*  25: 29 */     URLConnection hpCon = strBill.openConnection();
    /*  26: 30 */     int len = hpCon.getContentLength();
    /*  27: 32 */     if (len > 0)
    /*  28:    */     {
    /*  29: 36 */       BufferedReader in = new BufferedReader(
    /*  30: 37 */         new InputStreamReader(strBill.openStream()));
    /*  31: 38 */       vBill = in.readLine();
    /*  32:    */     }
    /*  33:    */     else
    /*  34:    */     {
    /*  35: 45 */       vBill = "0";
    /*  36:    */     }
    /*  37: 49 */     System.out.println("YourBill : " + vBill);
    /*  38:    */   }
    /*  39:    */   
    /*  40:    */   public void doAction(String name, ActionElementData actionAPI)
    /*  41:    */     throws AudiumException
    /*  42:    */   {
    /*  43: 63 */     String strCustID = (String)actionAPI.getSessionData("QueueIDs");
    /*  44:    */     try
    /*  45:    */     {
    /*  46: 66 */       GetDataBill(strCustID);
    /*  47:    */     }
    /*  48:    */     catch (Exception e)
    /*  49:    */     {
    /*  50: 69 */       System.out.println("0");
    /*  51:    */     }
    /*  52: 74 */     String balance = vBill.trim();
    /*  53: 81 */     if (balance == "0")
    /*  54:    */     {
    /*  55: 83 */       actionAPI.removeAllSessionData();
    /*  56: 84 */       actionAPI.setSessionData("balance", balance);
    /*  57:    */     }
    /*  58:    */     else
    /*  59:    */     {
    /*  60: 91 */       String strSess = balance.substring(0, 1);
    /*  61: 92 */       String strSess2 = balance.substring(1);
    /*  62:    */       
    /*  63:    */ 
    /*  64: 95 */       actionAPI.setSessionData("StsBill", strSess);
    /*  65: 96 */       actionAPI.setSessionData("ValBill", strSess2);
    /*  66: 99 */       if (strSess > "1")
    /*  67:    */       {
    /*  68:102 */         actionAPI.setSessionData("StsBill", "1");
    /*  69:103 */         actionAPI.setSessionData("balance", strSess2);
    /*  70:    */       }
    /*  76:110 */       if (strSess == "0")
    /*  77:    */       {
    /*  78:112 */         actionAPI.setSessionData("StsBill", "0");
    /*  79:113 */         actionAPI.setSessionData("balance", strSess2);
    /*  80:    */       }
    /*  81:115 */       if (strSess == "9")
    /*  82:    */       {
    /*  83:117 */         actionAPI.setSessionData("StsBill", "9");
    /*  84:118 */         actionAPI.setSessionData("balance", "0");
    /*  85:    */       }
    /*  86:121 */       if (strSess2.trim() == "") {
    /*  87:122 */         actionAPI.setSessionData("balance", "0");
    /*  88:    */       } else {
    /*  89:124 */         actionAPI.setSessionData("balance", strSess2);
    /*  90:    */       }
    /*  91:    */     }
    /*  92:    */   }
    /*  93:    */ }
    please help Me

  • Call apt inside a java class

    Hi all,
    Is it possible to call the Annotation Processing Tool inside a Java class ?
    If yes, how to perform this call ?
    Thanks.
    Micka�l

    Hello Micka�l,
    Here is a test class for one of my apt processors.
    https://rapt.dev.java.net/source/browse/rapt/test/net/java/dev/rapt/exploratory/mixin/TestMixins.java?rev=1.1&view=markup
    The code to call apt is in the last method called "runApt". Note that this method takes the source code to be compiled as a String and writes it to a file, but YOU may not want to do that.
    Oh, and if you try to understand the rest of the code, there is lots of source inside javadoc comments. Basically, each @LongString static String is initialized to the value of its javadoc comment. Which is cool for writing tests but really confusing if you are not aware of what is happening - and I was hoping to help you, not confuse you :)
    Bruce

  • Call a function in servlet from java class.

    Hi,
    I am implementing a client/server technology by trying to convert a java desktop client into Browser based. As part of user authetication the only way I know that a username /password does not match is from the servers message as i dont have documentation of the backend servers database.
    Here is a fucntion which receives lines form server.
    public class ServerComm{
    public synchronized void receiveMessage(String  serverMessage){
    if (serverMessage.equals("Login-Fail"))// Login-Fail is message from server if login fails
    LoginHandler.loginFail()//Login Handler is a servlet
    return
    }The Login Handler servlet is as follows.
    public class LoginHandler extends HttpServlet {
        /** Initializes the servlet.
        public void init(ServletConfig config) throws ServletException {
            super.init(config);
        /** Destroys the servlet.
        public void destroy() {
        /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
        protected synchronized void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    //some expressions.       
       //this is reached if login fails.
        public static void  loginFail(){
            HttpServletResponse response;
        //redirected to wronglogin web page.  
      response.sendRedirect("/mCVW/wronglogin.jsp");
        /** Handles the HTTP <code>GET</code> method.
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
        /** Handles the HTTP <code>POST</code> method.
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            processRequest(request, response);
       }Now there is problem in loginFail() method in LoginHandler servlet does not work with the type of response decleration . I need some assistance from any one to make this work or propose a better solution for determining the user authetication with the restriction i have.
    Thank you.

    hmm...I haven't tried this before...but does this work by any chance?
    In your ServerComm class, create new HttpServletRequest and Response objects and get a RequestDispatcher object from request.
    Eg : if (serverMessage.equals("login-fail"){
    HttpServletRequest request = new HttpServletRequest ();
    HttpServletResponse response = new HttpServletResponse ();
    request.setAttribute("function_id", "loginFail");
    RequestDispatcher dispatcher = request.getRequestDispatcher("http://servername:port/ServletName");
    //give the complete path of your servlet
    dispatcher.forward(request, response);
    and in your Servlet, get this function_id and if its loginFail, redirect it to wronlogin.jsp...
    public class MyServlet extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException
    String function_id = request.getAttribute("function_id");
    if(function_id.equalsIgnoreCase("loginFail"))
    //forward to ur jsp
    getServletConfig().getServletContext().getRequestDispatcher(wronlogin.jsp").forward(request, response);
    }

  • Calling external servlet from java stored procedure

    Hello,
    I need to call an external servlet which is in 9iAS server ( unix box) from Java Stored procedure in oracle database.
    Can anybody give me an idea? is it possible?
    Thanks,
    Viswa

    I am trying the same. Here is URL which will help u.
    http://otn.oracle.com/sample_code/tech/java/jsp/samples/wsclient/Readme.html
    Let me know when you run servlet successfully.
    Regards
    Satish

Maybe you are looking for

  • Problem with display of a character (value 65533)

    Hi all, sorry for my english but i don't speak it very well. I have a big problem with the visualization of a character. I have a binary text that i have to analyze with java. With my utility all works fine, but when i get the character (binary 81)

  • IPod Touch not recognised by Windows 8 or iTunes whilst in Recovery mode.

    Hello! I recently updated my iTunes account and during the update on syncing my iPod touch (5th gen) my iPod put itself in to recovery mode and now both iTunes and my computer (in Windows 8) wont recognise my iPod. I've followed the steps here> https

  • How to change default Server NFS version in Solaris 10 ?

    How to change default Server NFS version in Solaris 10 ? I need to change default version of NFS server version, currently i have NFS_SERVER_VERSMAX=2, for changing NFS version i changed this variable in /etc/default/nfs, but still its using version

  • I-Phone 6 not visible in I-tunes. Error no 0x8000084

    My I-phone 6  and its internal storage files are visible in explorer but not in I-tunes. On connecting a window opens stating Error no 0x8000084. Disconnecting and reconnecting makes no difference. How do I correct this problem?

  • Automatic update of web.xml when running UIX application

    I moved my UIX project from 9.02 to 9.03. The UIX resource files have changed between the versions so I deleted the old cabo folder so that when I ran my applicaton for the first time it would rebuild it. When I ran my application my web.xml file was