简体   繁体   English

Java:Google App Engine“此URL不支持HTTP方法POST”错误

[英]Java: Google App Engine “HTTP method POST is not supported by this URL” error

I just started playing with Google App Engine and Java. 我刚开始玩Google App Engine和Java。 I've used Servlets in the past and I understand how they work. 我过去使用过Servlets,我理解它们是如何工作的。 I'm trying to make a servlet to POST to, but it's not going over very well. 我正在尝试将一个servlet发布到POST ,但它并没有很好地完成。

Here's my Servlet: 这是我的Servlet:

public class CreateUser extends HttpServlet
{
    private static final long serialVersionUID = 1L;

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException
    {
        ...
    }
}

Here's what I get when I post to this from a form: 这是我从表单发布到这里时得到的结果:

HTTP ERROR 405
Problem accessing /user/create. Reason:
HTTP method POST is not supported by this URL

I don't understand why I'm getting this when I clearly have implemented doPost. 当我明确实施doPost时,我不明白为什么我会这样做。 I've double and triple checked the DD (web.xml) file to make sure I have the url mappings correct. 我已经对DD(web.xml)文件进行了两次和三次检查,以确保我的url映射是正确的。 I can't find anything online specifically about this. 我在网上找不到任何关于此的内容。 I figure I am over looking something quite simple. 我想我看起来很简单。

Here's my web.xml: 这是我的web.xml:

<web-app...>
    ...
    <servlet>
        <servlet-name>CreateUser</servlet-name>
        <servlet-class>com.joelj.music.api.CreateUser</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Index</servlet-name>
        <url-pattern>/user/create</url-pattern>
    </servlet-mapping>
</web-app>

Thanks. 谢谢。

I feel really stupid. 我觉得真的很蠢。 After looking at the code I just posted I realized that the entry was pointed to Index. 看完我刚刚发布的代码后,我意识到该条目指向了Index。 I can't believe I over looked it so many times. 我不敢相信我看了这么多次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 此网址不支持在Google App Engine 405 HTTP方法GET中获取此错误 - Getiing this error in google app engine 405 HTTP method GET is not supported by this URL 我是jsp和google app引擎的新手,但出现此错误:此URL不支持HTTP方法GET。 - I am new to jsp and google app engine getting this error: HTTP method GET is not supported by this URL 此 URL Java servlet 不支持 HTTP 方法 POST - HTTP method POST is not supported by this URL Java servlet HTTP状态405 - 此URL URL servlet不支持HTTP方法POST - HTTP Status 405 - HTTP method POST is not supported by this URL java servlet 带有URL的POST上的Google App Engine“未找到”错误 - Google App Engine “Not Found” error on POST with url 从API方法到Servlet的Google App Engine Java HTTP Post Image - Google App Engine Java HTTP Post Image from API Method to Servlet Tomcat Servlet返回错误405-此URL不支持HTTP方法POST - Tomcat Servlet returns Error 405 - HTTP method POST is not supported by this URL Spring JSP到控制器的重定向错误:此URL不支持HTTP方法POST - Spring jsp to controller redirect error :HTTP method POST is not supported by this URL 为什么会出现错误“此URL不支持HTTP方法发布”? - Why I got the error “HTTP method post is not supported by this URL”? JBOSS 上的此 URL 不支持 HTTP 方法 POST - HTTP method POST is not supported by this URL on JBOSS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM