Skip to content

Form params seem not to work, in dev environment only, after AppEngine 1.5+ #45

@drcode

Description

@drcode

Hi everyone- I had posted a couple of months ago about an issue I had after upgrading to AppEngine 1.5+. The issue seems to persist with the latest appengine-magic, though the problem could also be due to a bug in ring, hiccup, or for that matter my java/jetty environment.

The app works fine when pushed into production. I have pushed a minimal app that reproduces the problem to http://formbug.appspot.com/. If you enter a username and submit it, it will echo it back on the followup page, as it should. When I try it in the dev environment however, it doesn't work, even though it worked fine on AppEngine 1.4.x. In that case, I can see the forms param properly submitted via the browser, but never seems to appear in the request object in my defroutes. Therefore, no matter what is typed into the form, the echoed result is always "The username is ".

I should point out that I've done some relatively complex development with AppEngine 1.5+ and appengine-magic and everything is working perfectly for me except for this one isolated issue.

I already tried digging into ring/hiccup/appengine-magic to see if I could find an exact cause and create a patch, but there is enough going on here that I have a hard time pinning down the cause of the issue (but I plan to look into this some more)

Here is the core.clj for my test app:

(ns formbug.core
  (:use [compojure.core :only [defroutes GET POST PUT DELETE ANY]]
        [ring.middleware.params :only [wrap-params]])
  (:require [appengine-magic.core :as ae]))

(defroutes formbug-app-handler
  (GET "/" [req]
       "<form name='input' action='post_url' method='post'>
Username: <input type='text' name='user' />
<input type='submit' value='Submit' />
</form>")
  (POST "/post_url" [user]
        {:status 200
         :headers {"Content-Type" "text/plain"}
         :body (str "the username is " user)}
        ))

(ae/def-appengine-app formbug-app
  (-> #'formbug-app-handler
      wrap-params))    

Here is my project.clj:

(defproject formbug "1.0.0-SNAPSHOT"
  :description "FIXME: write description"
  :dependencies [[org.clojure/clojure "1.2.1"]
                 [org.clojure/clojure-contrib "1.2.0"]
                 [hiccup "0.3.6"]
                 [compojure "0.6.4"]]
  :dev-dependencies [[appengine-magic "0.4.4"]])        

Since this might conceivably be environment-related, here are my dev box specs:

 Ubuntu 11.04
 AppEngine Release: 1.5.3
 Java(TM) SE Runtime Environment (build 1.7.0-b147)
 Java HotSpot(TM) Server VM (build 21.0-b17, mixed mode)

If any of you happen to know why this is failing, please let me know. I realize it may not actually be an appengine-magic issue. I will keep investigating on my end, as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions