| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -98,15 +98,17 @@ public void actionPerformed(ActionEvent e) { | |||
| 98 | 98 | public void hyperlinkUpdate(HyperlinkEvent e) { | |
| 99 | 99 | //System.out.println(e); | |
| 100 | 100 | if (e instanceof FormSubmitEvent) { | |
| 101 | - //System.out.println("got submit event"); | ||
| 102 | 101 | String result = ((FormSubmitEvent) e).getData(); | |
| 103 | 102 | StringDict dict = new StringDict(); | |
| 104 | - String[] pairs = result.split("&"); | ||
| 105 | - for (String pair : pairs) { | ||
| 106 | - String[] pieces = pair.split("="); | ||
| 107 | - String attr = PApplet.urlDecode(pieces[0]); | ||
| 108 | - String valu = PApplet.urlDecode(pieces[1]); | ||
| 109 | - dict.set(attr, valu); | ||
| 103 | + if (result.trim().length() != 0) { | ||
| 104 | + String[] pairs = result.split("&"); | ||
| 105 | + for (String pair : pairs) { | ||
| 106 | + System.out.println("pair is " + pair); | ||
| 107 | + String[] pieces = pair.split("="); | ||
| 108 | + String attr = PApplet.urlDecode(pieces[0]); | ||
| 109 | + String valu = PApplet.urlDecode(pieces[1]); | ||
| 110 | + dict.set(attr, valu); | ||
| 111 | + } | ||
| 110 | 112 | } | |
| 111 | 113 | //dict.print(); | |
| 112 | 114 | handleSubmit(dict); | |
@@ -159,7 +161,7 @@ public void handleClose() { | |||
| 159 | 161 | /** | |
| 160 | 162 | * Override this to do something interesting when a form is submitted. | |
| 161 | 163 | * To keep things simple, this doesn't allow for multiple params with the | |
| 162 | - * same name. | ||
| 164 | + * same name. If no params submitted, the Dict will be empty (not null). | ||
| 163 | 165 | */ | |
| 164 | 166 | public void handleSubmit(StringDict dict) { | |
| 165 | 167 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments