app.yaml
application: cloudymovie
version: 1
runtime: java
welcome_files:
- test.jsp
handlers:
- url: /test/*
- servlet: com.test.TestLexerServlet
- name: testlexertest.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test</title>
</head>
<body>
<form action="/test/" method="get">
<input type="submit" value="Go">
</form>
</body>
</html>然后当我按下按钮
HTTP ERROR 404
Problem accessing /test/. Reason:
NOT_FOUND
Powered by Jetty://我在自动生成的web.xml中发现
<servlet-mapping>
<servlet-name>com.test.TestLexerServlet</servlet-name>
<url-pattern>null</url-pattern>
</servlet-mapping>url-pattern不应为空
我是新来GAE的。谢谢你的建议。
发布于 2011-06-06 14:29:53
/test/*将匹配“/test”、“/test/”、“/test//”等--可能不是您想要的。请尝试使用/test/.*。
然而,问题的根本原因是您的YAML标记无效。而不是这样:
handlers:
- url: /test/*
- servlet: com.test.TestLexerServlet
- name: testlexer它应该看起来像这样:
handlers:
- url: /test/*
servlet: com.test.TestLexerServlet
name: testlexerhttps://stackoverflow.com/questions/6248061
复制相似问题