Permalink
Browse files

We are now using a RESTful URL for the REST call in this sample appli…

…cation.
  • Loading branch information...
1 parent bf11de5 commit b12d35866b729d85763ab04e36b5afcbc7f547b3 @maryvogt maryvogt committed Jun 22, 2011
Showing with 15 additions and 8 deletions.
  1. +4 −0 .htaccess
  2. +3 −1 build.xml
  3. +1 −1 hellospiffyphp.php
  4. +7 −6 src/main/java/org/spiffyui/hellospiffyphp/client/Index.java
View
@@ -0,0 +1,4 @@
+Options +FollowSymlinks
+RewriteEngine on
+RewriteBase /target/www
+RewriteRule ^hellospiffyphp/(.*)$ hellospiffyphp.php?name=$1
View
@@ -2,7 +2,9 @@
<project name="Spiffy UI Framework Sample Project" xmlns:ivy="antlib:org.apache.ivy.ant" default="all" basedir=".">
<target name="all" depends="setup,resolve" description="Build, compile, and package the entire application">
- <copy file="${root}/hellospiffyphp.php" todir="${sample.out.www}"/>
+ <copy file="${root}/hellospiffyphp.php" todir="${sample.out.www}"/>
+ <copy file="${root}/.htaccess" todir="${sample.out.www}"/>
+
<antcall target="gwt-compile">
<param name="gwttarget" value="org.spiffyui.hellospiffyphp.index"/>
</antcall>
View
@@ -95,7 +95,7 @@ function emit_json_data() {
?>
{
- "user" : <?php emit_user() ?> ,
+ "user" : <?php "HI THERE!!! " . emit_user() ?> ,
"userAgent" : <?php emit_agent() ?>,
"serverInfo" : <?php echo(get_server_info()) ?>
@@ -47,7 +47,6 @@
private static Index g_index;
private TextBox m_text = new TextBox();
-// private CheckBox m_triggerError = new CheckBox();
private Button m_submit = new Button("Submit");
private Button m_submitWithError = new Button("Submit and trigger error");
private LongMessage m_longMessage = new LongMessage("longMsg");
@@ -123,16 +122,18 @@ public void onKeyPress(KeyPressEvent event)
*/
private void sendRequest(boolean triggerError)
{
- String q = m_text.getValue().trim();
- if (q.equals("")) {
+ String name = m_text.getValue().trim();
+ if (name.equals("")) {
MessageUtil.showWarning("Please enter your name in the text field.", false);
return;
}
- String restURL = "hellospiffyphp.php";
- restURL = restURL + "?name=" + q; // we know we have a name because we passed the check above
+ String restURL = "hellospiffyphp";
+ restURL = restURL + "/" + name; // we know we have a name because we passed the check above
+
if (triggerError) {
- restURL = restURL + "&triggererror=TRUE";
+ // this is not a very RESTful way to do this but it's just to show the error handling
+ restURL = restURL + "?triggererror=TRUE";
}
RESTility.callREST(restURL, new RESTCallback() {

0 comments on commit b12d358

Please sign in to comment.