状态码异常(com.google.gwt.user.client.rpc.StatusCodeException:404< html>) [英] Status Code Exception (com.google.gwt.user.client.rpc.StatusCodeException: 404 <html>)
本文介绍了状态码异常(com.google.gwt.user.client.rpc.StatusCodeException:404< html>)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在运行登录应用程序(使用GWT-RPC)时出现此错误。我该如何解决这个问题?我也提供了错误列表。我缺少什么?
------ VinLog.html
< pre class =lang-html prettyprint-override>
<!doctype html>
< html>
< head>
< meta http-equiv =content-typecontent =text / html; charset = UTF-8>
< link type =text / css =stylesheethref =VinLog.css>
< title> VinLog< / title>
< script language =javascriptsrc =com.login.vinayak.VinLog / com.login.vinayak.VinLog.nocache.js>< / script>
< / head>
< body>
<! - 可选:如果您需要历史记录支持,请添加此项 - >
< iframe id =__ gwt_historyFramestyle =width:0; height:0; border:0>< / iframe>
< / body>
< / html>
------ web.xml
> <?xml version =1.0encoding =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应用程序> < servlet的>
> < servlet的名称>&GreetingServiceImpl LT; / servlet的名称>
> < servlet的类> com.login.vinayak.server.GreetingServiceImpl< / servlet的类>
> < / servlet的> < servlet的映射>
> < servlet的名称>&GreetingServiceImpl LT; / servlet的名称>
> < URL模式> /登录< / url-pattern的> < / servlet的映射> <! - 要提供的默认页面 - > <欢迎-文件列表>
> <欢迎-文件>&VinLog.html LT; /欢迎-文件> < /欢迎-文件列表>
> < / web应用程序>
------ 错误列表
com.google.gwt.user.client.rpc.StatusCodeException:404< html>
< head>
< meta http-equiv =Content-Typecontent =text / html; charset = ISO-8859-1/>
< title>错误404 NOT_FOUND< / title>
< / head>
< body>< h2> HTTP错误: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>
解决方案
您为servlet注册了URL/ Login ,但你打电话给/登录。
您需要更改< url-pattern>
改为小写,或者将 @RemoteServiceRelativePath
改为大写。然后重新启动服务器。
I'm getting this error while running the login application (Using GWT-RPC). How can I resolve this? I have provided the error list as well. What I'm missing?
------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>
------error list
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>
解决方案
You registered your servlet for the URL "/Login", but you're calling "/login".
You need to change either the <url-pattern>
to lower case, or your @RemoteServiceRelativePath
to upper case. Then restart the server.
这篇关于状态码异常(com.google.gwt.user.client.rpc.StatusCodeException:404< html>)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文