Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting a parameter in redirect URL



Hello,

   I'm doing a simple redirect to a DirectAction and want to add a couple parameters to the URL.  I do this with the following code:

  public WORedirect login() {
   NSMutableDictionary dict = new NSMutableDictionary();
dict.takeValueForKey(username, "NICK");
    dict.takeValueForKey(userID, "USER");
    String url = "">
"login", dict );
    WORedirect redirect = new WORedirect(context());
    redirect.setUrl(url);
    return redirect;
}

However, when I pick up the parameters on the other side, there is a stray "&" being added before the NICK parameter.  Just wondering why?
Here's the code for picking up the parameters and printing out their values:

NSDictionary formVals = this.request().formValues();
System.out.println("login Hyperlink values: " +
  formVals);
System.out.println("login cookie values: " + this.request().cookieValues().toString());
UserInfoWindow page = (UserInfoWindow) pageWithName("UserInfoWindow");
String username = (String) formVals.valueForKey("NICK");

When I print the dictionary out it shows:

login Hyperlink values: {amp;NICK = ("FireBreathers"); USER = ("1004"); amp;wosid = ("a1snzyY9gzOgLCObCkS5kg"); }

When I try to retrieve the NICK value, I get a null returned.  Retrieving the USER value works fine.

Any ideas?  I'm guessing it has to do with the extra & value, but I'm not sure how to get rid of it.

Thanks,
Jeff
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/email@hidden

This email sent to email@hidden

References: 
 >takeValueFromRequest phase (From: Lachlan Deck <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.