I need that to be in the url so it can be captured by Google Analytics. Alexey Hanin wrote: > > Don't have an opportunity to check this but as I know Tapestry treats > empty parameters as nulls. Just curious, why do you want empty > parameter in query string? Conceptually, parameters not being set > makes it null. > > On Mon, Nov 9, 2009 at 3:50 PM, Angelo Chen <angelochen...@yahoo.com.hk> > wrote: >> >> Hi, >> Thanks for the reply, but it does not work, still same error, i check the >> LinkImpl: >> >> public void addParameter(String parameterName, String value) >> { >> Defense.notBlank(parameterName, "parameterName"); >> Defense.notBlank(value, "value"); >> >> if (parameters == null) >> parameters = CollectionFactory.newMap(); >> >> parameters.put(parameterName, value); >> } >> >> it is making sure the value is not blank, but I believe query string >> having >> blank value is often. >> >> >> Alexey Hanin wrote: >>> >>> Just make it empty string when it's null: >>> >>> lnk.addParameter("country", country == null ? "" : country); >>> >>> On Mon, Nov 9, 2009 at 3:24 PM, Angelo Chen <angelochen...@yahoo.com.hk> >>> wrote: >>>> >>>> Hi, >>>> >>>> I have a query string that I need to append to a Link object, the >>>> query >>>> string is: >>>> >>>> ?gender=M&country= >>>> >>>> I got two questions: >>>> >>>> 1) is there a simple way to append this string to a Link object instead >>>> of >>>> using addParameter? >>>> >>>> 2) if I do a lnk.addParameter("country", null) and I got following: >>>> >>>> RequestExceptionHandler Unexpected runtime exception: Parameter value >>>> was >>>> null or contained only whitespace. >>>> >>>> and I need to make the country part of query string even it is null, >>>> any >>>> idea? thanks, >>>> >>>> A.C. >>>> -- >>>> View this message in context: >>>> http://old.nabble.com/t5%3A-Link-s-addParameter-and-null-tp26266356p26266356.html >>>> Sent from the Tapestry - User mailing list archive at Nabble.com. >>>> >>>> >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>>> For additional commands, e-mail: users-h...@tapestry.apache.org >>>> >>>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >>> For additional commands, e-mail: users-h...@tapestry.apache.org >>> >>> >>> >> >> -- >> View this message in context: >> http://old.nabble.com/t5%3A-Link-s-addParameter-and-null-tp26266356p26266715.html >> Sent from the Tapestry - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org >> For additional commands, e-mail: users-h...@tapestry.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > >
-- View this message in context: http://old.nabble.com/t5%3A-Link-s-addParameter-and-null-tp26266356p26267129.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org