• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Passing "#" as a request parameter

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am looking into an issue which is the following:
A struts action class is being called like this:


This populates the indexCode and determinationDate fields of the RstGlobalKeyVerificationForm

The issue happens when index code contains a # - like "ABC 123 #GFR1"
In this case, everything after the # including the determinationDate is not populated, and hence even indexCode gets populated only with "ABC 123"

This is causing problems down the line, since the entire index code and determination date values are needed for calculations.

Please help!!

Thank you
Karthik
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should probably be URLEncoding anything you put in that link that comes from a variable.

So, it should probably be something like this.


This will convert any unusual characters into something that should make any links work fine.
 
Karthik Krishnamurthy
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Worked like a charm, though I used URLEncoder.encode(String,"UTF-8") since URLEncoder.encode(String) is deprecated.

Thanks a bunch

Karthik
reply
    Bookmark Topic Watch Topic
  • New Topic