状态代码异常(com.google.gwt.user.client.rpc.StatusCodeException:404)

时间:2012-10-12 06:51:18

标签: exception gwt http-status-code-404 gwt-rpc http-error

我在运行登录应用程序时遇到此错误(使用GWT-RPC)。我该如何解决这个问题?我也提供了错误列表。我缺少什么?

------ VinLog.html

   <!doctype html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=UTF-8">
        <link type="text/css" rel="stylesheet" href="VinLog.css">
        <title>VinLog</title>
        <script language="javascript" src="com.login.vinayak.VinLog/com.login.vinayak.VinLog.nocache.js"></script>

    </head>
    <body>

        <!-- OPTIONAL: include this if you want history support -->
        <iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>

    </body>
</html>

------ 的web.xml

>  <?xml version="1.0" encoding="UTF-8"?> <!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>GreetingServiceImpl</servlet-name>
>        <servlet-class>com.login.vinayak.server.GreetingServiceImpl</servlet-class>
> </servlet>    <servlet-mapping>
>        <servlet-name>GreetingServiceImpl</servlet-name>
>        <url-pattern>/Login</url-pattern>    </servlet-mapping>    <!-- Default page to serve -->  <welcome-file-list> 
>       <welcome-file>VinLog.html</welcome-file>    </welcome-file-list>   
> </web-app>

------ 错误列表

com.google.gwt.user.client.rpc.StatusCodeException: 404 <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 404 NOT_FOUND</title>
</head>
<body><h2>HTTP ERROR: 404</h2><pre>NOT_FOUND</pre>
<p>RequestURI=/com.login.vinayak.VinLog/login</p><p><i><small><a href="http://jetty.mortbay.org/">Powered by Jetty://</a></small></i></p><br/>                                                
<br/>                                                
<br/>                                                

</body>
</html>

1 个答案:

答案 0 :(得分:1)

您在servlet上注册了URL“/ Login”,但是您正在调用“/ login”。

您需要将<url-pattern>更改为小写,或将@RemoteServiceRelativePath更改为大写。然后重新启动服务器。