Although I have never heard of cloud computing news and answered questions about Google App Engine persistence in csdn forums, I have not linked the two. I always thought that gae is an open-source project similar to spring or hibernate. Recently, when I was thinking about the open-source project of technology genealogy, I first wanted to find a free jspspace for preliminary testing and found that gae is Google's cloud computing platform, its free traffic and computing capabilities are quite impressive, which is undoubtedly a big pie in the sky for me.
Using the Eclipse plug-in provided by Google, development is still very convenient, and there is no big difference with writing common Java Web programs, however, the local simulated environment provided by the plug-in is still somewhat different from the real environment after deployment. From the start, to the real release of a simplest function (ECHO, I spent about three days in my spare time and encountered several small problems. I would like to summarize them here and hope they will be useful to everyone.
My Gae version: 1.2.2
The first point is worth noting.
The Gae plug-in automatically clears the WEB-INF/classes directory each time it is packaged, so struts. XML, log4j. properties and other configuration files cannot be directly stored in this directory. They can be placed in the src directory, or an independent directory can be created, such as CFG to store the configuration file, add the directory to the class directory.
Second, jstl labels cannot be used by default (no error is reported or parsed ).
You need to add iselignored = "false" to the page ction of the JSP page, for example:
<% @ Page contenttype = "text/html; charset = UTF-8" Language = "Java" pageencoding = "UTF-8"Iselignored = "false"%>
Officially, this may be related to the Jasper version they are using and may be improved during the next upgrade. See: http://groups.google.com/group/google-appengine-java/msg/da389df15e056697? Hl = en
Third, Chinese problems.
Developed on Windows, the default file encoding is GBK. At this time, if the JSP page also sets encoding to GBK, you usually need to add a filter to implement encoding conversion to eliminate garbled code. I changed the entire project to UTF-8, that is, the file encoding UTF-8, And the charset specified in JSP is also a UTF-8, the Chinese problem can be solved naturally (no additional filter ).
Fourth, struts2 is integrated, but by default, the application access after deployment fails due to the ongl permission.
This problem will not occur during local testing, but the following exception will be thrown during deployment:
Error message:
08-31 AM 19.209/XXXXXXX. Action? Fromurlencode = % E7 % BC % 96% E7 % A0 % 81 & fromurlnonencode = % E6 % 9C % Aa % E7 % BC % 96% E7 % A0 % 81 404 86 Ms 158cpu_ms 0kb Mozilla/ 4.0 (compatible; MSIE 7.0; Windows NT 5.1 ;. net CLR 2.0.50727 ;. net CLR 3.0.20.6.2152 ;. net CLR 3.5.30729), Gzip (gfe)
See details
117.79.68.140--[31/Aug/2009: 08: 37: 19-0700] "post/XXXXXXXX. Action? Fromurlencode = % E7 % BC % 96% E7 % A0 % 81 & fromurlnonencode = % E6 % 9C % Aa % E7 % BC % 96% E7 % A0 % 81 HTTP/1.1 "404 0" http://jszupu.appspot.com/xxxxxxx.jsp "" Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1 ;. net CLR 2.0.50727 ;. net CLR 3.0.20.6.2152 ;. net CLR 3.5.30729), Gzip (gfe) "" jszupu.appspot.com"
The official saying is that the security settings in the actual running environment are not the same as those in the simulation environment of the plug-in, and a solution is provided. You need to add a listener. The Listener content is as follows:
Public class onglpermissionlistener implements servletcontextlistener {<br/> Public onglpermissionlistener () {< br/>}</P> <p> Public void contextinitialized (letservcontextevent SCE) {<br/> ognlruntime. setsecuritymanager (null); <br/>}</P> <p> Public void contextdestroyed (servletcontextevent arg0) {<br/>}</P> <p>}
For official discussions on this issue, see: http://groups.google.com/group/google-appengine-java/browse_thread/thread/19018b0317f27817
Fifth, if the label file is used, the local test is successful, but an error occurs during deployment.
A Tag file is a jstl custom tag written under the WEB-INF/tags directory, not a standard JSP custom tag defined by a TLD file.
If this label file is used, an error occurs during deployment:
2009-9-5 19:35:04 org. Apache. Jasper. compiler. compiler generateclass
Severe: javac exception
Unable to find a javac compiler;
Com. Sun. Tools. javac. Main is not on the classpath.
Perhaps java_home does not point to the JDK
Google only provides a very bad solution to this problem, that is, to put the tools under JRE/lib. copy jar to the installation directory/lib/share of appengine. For details about the problem description and discussion process, see:
Http://groups.google.com/group/google-appengine-java/browse_thread/thread/225d7a555cbc0100/1a9cd7c6f39e663a? Lnk = raot
Http://groups.google.com/group/google-appengine-java/browse_thread/thread/175e70cc0c93ded9
Sixth, Chinese characters in the Tag file are garbled.
JSP page with UTF-8, Chinese no problem, but the label file with UTF-8 can not, this I did not find a solution, the online discussion of the information is very little, I don't know if it is related to my machine environment. In the end, I simply do not write Chinese characters in the Tag file, and use resource bundle to do it all.
7. How jstl labels are applied.
In JSP, jstl labels can be introduced using the following URL:
<% @ Taglib prefix = "C" uri = "http://java.sun.com/jsp/jstl/core" %>
In tag files
<% @ Taglib prefix = "C" uri = "http://java.sun.com/jstl/core" %>
For more information, see:
Http://groups.google.com/group/google-appengine-java/browse_thread/thread/affd7e7a83f614e1
You are welcome to share your experiences.