• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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
 
So it takes a day for light to pass through this glass? So this was yesterday's tiny ad?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic