Results 1 to 3 of 3

Thread: erorr 404

  1. #1
    miko5054 is offline Member
    Join Date
    Mar 2010
    Posts
    50
    Rep Power
    0

    Default erorr 404

    im newby at servlets id tried this code in our class and it worked well
    but in my home i guess their is a problem...

    this is the code
    Java Code:
     package myServlate;
    
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.Calendar;
    import java.util.Date;
    
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    
    /**
     * Servlet implementation class UnsofictectedClock
     */
    public class UnsofictectedClock extends HttpServlet {
    	private static final long serialVersionUID = 1L;
           
        /**
         * @see HttpServlet#HttpServlet()
         */
        public UnsofictectedClock() {
            super();
            // TODO Auto-generated constructor stub
        }
    
    	/**
    	 * @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response)
    	 */
    	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    		
    		Date curnnetTime=new Date();
    		response.setIntHeader("refresh", 1);
    		PrintWriter out = response.getWriter();
    		out.println("<html><body>");
    		out.println("<h1>  " +curnnetTime.toString()+ " <h1/>");
    		out.println("</html></body>");
    		out.close();
    		
    	}
    	
    
    }

    this is the xml file
    Java Code:
      <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.4" 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">
    	<display-name>
    	OnlineStore</display-name>
    	<servlet>
    		<description>
    		</description>
    		<display-name>
    		Controler</display-name>
    		<servlet-name>Controler</servlet-name>
    		<servlet-class>
    		myServlate.Controler</servlet-class>
    		<init-param>
    			<description>
    			support email</description>
    			<param-name>email</param-name>
    			<param-value>support@online.store</param-value>
    		</init-param>
    	</servlet>
    	<servlet>
    		<description>
    		</description>
    		<display-name>
    		LoginServlet</display-name>
    		<servlet-name>LoginServlet</servlet-name>
    		<servlet-class>
    		myServlate.LoginServlet</servlet-class>
    	</servlet>
    	<servlet>
    		<description>
    		</description>
    		<display-name>
    		UnsofictectedClock</display-name>
    		<servlet-name>UnsofictectedClock</servlet-name>
    		<servlet-class>
    		myServlate.UnsofictectedClock</servlet-class>
    	</servlet>
    	<servlet-mapping>
    		<servlet-name>Controler</servlet-name>
    		<url-pattern>/Controler</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>LoginServlet</servlet-name>
    		<url-pattern>/Shmakaka</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>UnsofictectedClock</servlet-name>
    		<url-pattern>/UnsofictectedClock</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>UnsofictectedClock</servlet-name>
    		<url-pattern>/Clock</url-pattern>
    	</servlet-mapping>
    	<welcome-file-list>
    		<welcome-file>index.html</welcome-file>
    		<welcome-file>index.htm</welcome-file>
    		<welcome-file>index.jsp</welcome-file>
    		<welcome-file>default.html</welcome-file>
    		<welcome-file>default.htm</welcome-file>
    		<welcome-file>default.jsp</welcome-file>
    	</welcome-file-list>
    </web-app>

    and that what im receive from the browser

    Java Code:
       type Status report
    
    message /%E2%80%AA%E2%80%AA/onlineStore/Clock
    
    description The requested resource (/%E2%80%AA%E2%80%AA/onlineStore/Clock) is not available.

    thanks allot

    miki

  2. #2
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    6

    Default

    well, you have that servlet mapped to /Clock within your application context (which i assume is "onlineStore/" ?)

    So what is this /%E2%80%AA%E2%80%AA stuff about, where is that being generated from. I suspect if don't mean that as a fancy kind of host name obfuscation for forum post, that if you are actually invoking that as the relative url onto your host, that it is confusing this first part as the app context.

  3. #3
    miko5054 is offline Member
    Join Date
    Mar 2010
    Posts
    50
    Rep Power
    0

Similar Threads

  1. Replies: 0
    Last Post: 07-28-2009, 04:46 PM
  2. MyOwnEventExample Erorr!
    By Laythe in forum New To Java
    Replies: 4
    Last Post: 06-16-2009, 10:56 PM
  3. Interface and implementation erorr
    By mihael in forum Advanced Java
    Replies: 1
    Last Post: 12-07-2008, 12:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •