fix(appengine): removing obsolete symlink from java 8 on java 17 bundle services#10270
fix(appengine): removing obsolete symlink from java 8 on java 17 bundle services#10270Kef131 wants to merge 1 commit into
Conversation
…pendency to avoid JSP compilation failure
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request migrates the App Engine Datastore guestbook application to the Java 17 runtime. The review identified a critical Cross-Site Scripting (XSS) vulnerability in the JSP file, a violation of the Post-Redirect-Get (PRG) pattern in the servlet, and a UX issue where the pagination link is displayed even when no further results are available.
I am having trouble creating individual review comments. Click here to see my feedback.
appengine-java17-bundled-services/datastore/src/main/webapp/guestbook.jsp (28)
The user-provided content is rendered directly in the HTML without escaping. This creates a Cross-Site Scripting (XSS) vulnerability. Use <c:out> or fn:escapeXml to safely render user input.
<c:out value="${greeting.content}"/><br>
appengine-java17-bundled-services/datastore/src/main/java/com/example/appengine/AbstractGuestbookServlet.java (55-56)
After a successful doPost, the servlet forwards to the JSP instead of redirecting. This violates the Post-Redirect-Get (PRG) pattern, which can lead to duplicate form submissions if the user refreshes the page. Consider using a redirect after the greeting is appended.
guestbook.appendGreeting(content);
resp.sendRedirect(req.getRequestURI());
appengine-java17-bundled-services/datastore/src/main/java/com/example/appengine/ListPeopleServlet.java (88)
The "Next page" link is always displayed, even if there are no more results to fetch. This can lead to a poor user experience where clicking the link results in an empty page. You should only display the link if the number of results returned is equal to the PAGE_SIZE.
if (results.size() == PAGE_SIZE) {
w.println("<a href='/people?cursor=" + cursorString + "'>Next page</a>");
}
Description
Fixes #10242
Internal: b/496677589
This PR dereferences the symbolic links in the Java 17 App Engine bundled services module (
appengine-java17-bundled-services) that previously pointed to the deleted/legacyappengine-java8directory. By making these files self-contained, this module can run independently without relying on Java 8 code.Additionally, this PR adds the missing JSTL dependency to the Java 17
pom.xmlto resolve JSP runtime compilation errors (JasperException / ClassNotFoundException for guestbook_jsp) when running the development server locally withmvn appengine:run.This PR dereferenced 32 Symbolic links on
appengine-java17-bundled-services/datastoreChecklist
pom.xmlparent set to latestshared-configurationmvn clean verifyrequiredmvn -P lint checkstyle:checkrequiredmvn -P lint clean compile pmd:cpd-check spotbugs:checkadvisory only