http://groups.google.com/group/google-appengine-java/browse_thread/thread/1e3868a6a2661585首先参考这篇文章,修改一下sitemesh中的Factory.class。然后将修改后的包加入到gae项目中就可以啦。
下面是我的配置文件
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>
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
接下来在WEB-INF/下面新建一个decorators文件加,里面写个main.jsp
decorators.xml文件 注意红色字体,路径要写正确
<decorators defaultdir="/WEB-INF/decorators">
<decorator name="main" page="main.jsp">
<pattern>/*</pattern>
</decorator>
</decorators>
main.jsp 文件,很简单。
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator"
prefix="decorator"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page"%>
<!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><decorator:title default="这里随便放什么都行" />main</title>
<decorator:head />
</head>
<body>
纵贯线北京演唱会
<hr>
<decorator:body />
<hr>
没有票真可惜
</body>
</html>
sitemesh.xml文件
<sitemesh>
<page-parsers>
<parser default="true"
class="com.opensymphony.module.sitemesh.parser.DefaultPageParser" />
<parser content-type="text/html"
class="com.opensymphony.module.sitemesh.parser.FastPageParser" />
<parser content-type="text/html;charset=UTF-8"
class="com.opensymphony.module.sitemesh.parser.FastPageParser" />
</page-parsers>
<decorator-mappers>
<mapper
class="com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper">
<param name="config" value="/WEB-INF/decorators.xml" />
</mapper>
</decorator-mappers>
</sitemesh>
补充两个;
1 中文页面上传乱码问题可以参考这篇文章
http://www.jxva.com/blog/personal-diary/change-the-google-app-engine's-javac-compiler-encoding.html
上面无法访问的也可以看这个javaeye网友转载http://struts.iteye.com/blog/367952
2 上传出错问题,根据我这几天上传出错的经验 下面这个错误90%以上是jsp页面错误引起的
!MESSAGE Unable to upload app: Failed to compile java files.
See the Eclipse error log for more details
!STACK 0
com.google.appengine.tools.admin.AdminException: Unable to upload app: Failed to compile java files.
at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:47)
at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:203)
at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:97)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.RuntimeException: Failed to compile java files.
at com.google.appengine.tools.admin.Application.compileJavaFiles(Application.java:363)
at com.google.appengine.tools.admin.Application.compileJsps(Application.java:326)
at com.google.appengine.tools.admin.Application.createStagingDirectory(Application.java:235)
at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:39)
... 4 more
ps 今天特地学习的sitemesh,网上一搜,99%的中文文章都是重复的,天下文章一大抄啊。
分享到:
相关推荐
clock.rar 这是我今天做的一个基于google app engine写的一个在该平台上开发app的示例,通过该示例的学习,我们可以很快上手学会怎样在GAE上开发属于你的应用程序了,希望对大家有用!
GAE(Google App Engine)空间 GAE(Google App Engine)空间申请使用教程及 GAE域名捆绑方法使用教程及 GAE域 GAE(Google App Engine)空间申请使用教程及 GAE域名捆绑方法捆绑方法
基于Google App Engine(GAE)的Java和GWT应用开发_Google App Engine Java and GWT Application Development Nov.2010
一个应该在Google App Engine 上的一个实例。用Java语言编写,里面包含源代码。致以Google App Engine是什么,请Google。 实例部署的地址是:http://hellojavaweb.appspot.com
GAE Google App Engine 数据库部分
google app engine开发实例,实现了GAE的插入,更改,删除,搜索功能
Google App Engine is a key component of the Google Cloud Platform and one of the most comprehensive cloud services. Together with Python, the first programming language ever supported by the platform,...
云应用开发——Google App Engine & Google Web Toolkit入门指南 Google App Engine入门 Google App Engine 开发人员指南
Eclipse Google 插件 Google App Engine SDK for Java Google App Engine文档 按钮 Google App Engine 开发包
Google云端的一个重要部分,主要介绍了Google中App Engine的限制。
google app engine 的帮助文档 不过是英文版的 是我自己根据google官方文档用软件生成的chm版 有时候会出现“internet 脚本错误” 哪位高手可以修改以下让他不要出现 那就太感谢了
在google.appengine.ext.remote_api里面,我们看到这个离线访问GAE数据的这个API,这就意味着,定时任务之类的离线应用将可以在本地完成,如果你自己有一台服务器,那么在这台服务器上运行GAE的离线任务,将成为可能...
rest_gae, 在 Google App Engine python 中,在webapp2上的NDB模型的REST接口 rest_gaeNDB模型的REST接口在 Google App Engine python 上的webapp2.由 Yaron Budowski编写并维护。 给我发邮件:budowski@gmail.com ...
google_appengine_1.9.10 for linux 发布于2014-08-28 To install on Linux: Unzip the App Engine SDK file you downloaded (google_appengine_1.9.10.zip), for example: unzip google_appengine_1.9.10.zip ...
Using Google App Engine
菜鸟用GAE(Google_App_Engine)完全指南,网络穿越配置指南
Google App Engine Docs,Google App Engine开发人员指南(Java版),简体中文离线文档,起始页为主目录下的appengine\docs\docs.html
The App Engine SDK for Java includes a local development server as well as the tooling for deploying and managing your applications in App Engine. By downloading, you agree to be bound by the Terms ...
中文名: 基于Google App Engine(GAE)的Java和GWT应用开发 原名: Google App Engine Java and GWT Application Development 作者: Daniel Guermeur, Amy Unruh 资源格式: PDF 版本: 文字版 出版社: Packt ...
Google App Engine 是一种让您可以在 Google 的基础架构上运行您的网络应用程序。Google App Engine 应用程序易于构建和维护,并可根据您的访问量和数据存储需要的增长轻松扩展。使用 Google App Engine,将不再需要...