From 8ba079d5a881480258390178e144a668488404fd Mon Sep 17 00:00:00 2001 From: rjy7 Date: Wed, 16 Mar 2011 20:30:18 +0000 Subject: [PATCH] Comments --- .../controller/freemarker/IndividualController.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualController.java index 4904599e6..8867a9f8d 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/freemarker/IndividualController.java @@ -178,6 +178,18 @@ public class IndividualController extends FreemarkerHttpServlet { map = new HashMap(); map.put("currentValue", verboseValue); + /* Factors contributing to switching from a form to an anchor element: + - Can't use GET with a query string on the action unless there is no form data, since + the form data is appended to the action with a "?", so there can't already be a query string + on it. + - The browser (at least Firefox) does not submit a form that has no form data. + - Some browsers might strip the query string off the form action of a POST - though + probably they shouldn't, because the HTML spec allows a full URI as a form action. + - Given these three, the only reliable solution is to dynamically create hidden inputs + for the query parameters. + - Much simpler is to just create an anchor element. This has the added advantage that the + browser doesn't ask to resend the form data when reloading the page. + */ String url = vreq.getRequestURI() + "?verbose=" + !verboseValue; // Append request query string, except for current verbose value, to url String queryString = vreq.getQueryString();