1

运行登录应用程序(使用 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>
4

1 回答 1

1

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

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

于 2012-10-12T07:43:51.833 回答