make mistake in using XML to deploy web application archive file

Discussion in 'XML' started by cong, Jul 23, 2007.

  1. cong

    cong Guest

    web.xml:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app>
    <display-name>ShowLifecycles</display-name>
    <description>An example of how to use lifecycle events</
    description>

    <listener>
    <listener-class>
    examples.MyAppListener
    </listener-class>
    </listener>
    </web-app>

    ShowLifecycles.jsp:
    <html>
    <body>

    <%!
    public void jspInit()
    {
    log("***ShowLifecycles.jsp - Invoked jspInit()");
    }
    %>
    <%!
    public void jspDestroy()
    {
    log("***ShowLifecycles.jsp - Invoked jspDestroy()");
    }
    %>

    log("***ShowLifecycles.jsp - Invoked jspService()");
    %>

    The current date is: <%= new java.util.Date() %>
    </body>
    </html>

    MyAppListener:java
    package examples;

    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;

    public class MyAppListener
    implements ServletContextListener {

    public void contextInitialized(ServletContextEvent event) {
    ServletContext context = event.getServletContext();
    context.log("***ShowLifecycles - Created the servlet
    context");
    }

    public void contextDestroyed(ServletContextEvent event) {
    ServletContext context = event.getServletContext();
    context.log("***ShowLifecycles - Destroyed the servlet
    context");
    }
    }

    error information following:
    org.xml.SAXparseException
    the processing instruction target match "[xX][mM][lL]" is not allowed

    how can I fix it?
    cong, Jul 23, 2007
    #1
    1. Advertising

  2. > error information following:
    > org.xml.SAXparseException
    > the processing instruction target match "[xX][mM][lL]" is not allowed
    >
    > how can I fix it?


    The XML declaration MUST be the very first thing in the file, except for
    the optional byte-order mark. Remove the whitespace preceding it.

    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
    Joe Kesselman, Jul 23, 2007
    #2
    1. Advertising

  3. cong

    cong Guest

    On 7 23 , 8 04 , Joe Kesselman <> wrote:
    > > error information following:
    > > org.xml.SAXparseException
    > > the processing instruction target match "[xX][mM][lL]" is not allowed

    >
    > > how can I fix it?

    >
    > The XML declaration MUST be the very first thing in the file, except for
    > the optional byte-order mark. Remove the whitespace preceding it.
    >
    > --
    > () ASCII Ribbon Campaign | Joe Kesselman
    > /\ Stamp out HTML e-mail! | System architexture and kinetic poetry


    thank you
    cong, Jul 24, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lad
    Replies:
    2
    Views:
    230
    Tim Chase
    Oct 19, 2006
  2. Johny
    Replies:
    4
    Views:
    288
    Carsten Haese
    Feb 16, 2007
  3. cong
    Replies:
    0
    Views:
    260
  4. Replies:
    4
    Views:
    507
  5. GaryDean

    Deploy won't deploy Masterpage.master

    GaryDean, Apr 14, 2009, in forum: ASP .Net
    Replies:
    1
    Views:
    400
Loading...

Share This Page