• 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

javascript

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All
In my application i dynamically create link references and if they come to
be something like <a href="somefile.jsp?query=abc#09*(">link</a> and
clicking this link takes me to another page where i retrieve this query
value , i get only those characters before # appear(ie i get abc in this
case).can anybody suggest any way of transfering special characters in the
querystring....i have already tried out escape and unescape methods.
Hemant
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Special characters in URLs get escaped by converting them to the 2-digit hexadecimal value of the character with a '%' before it. ie a space character's hex code is 20 therefore it gets escaped as &space=%20
I don't have a list of the char to hex mappings but I'm sure someone has them somewhere (or you could write something to get them yourself)
Dave.
 
hemant singh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks david...but dont we have some method in java or JSP which does this for us automatically..

Originally posted by David O'Meara:
Special characters in URLs get escaped by converting them to the 2-digit hexadecimal value of the character with a '%' before it. ie a space character's hex code is 20 therefore it gets escaped as [b]&space=%20
I don't have a list of the char to hex mappings but I'm sure someone has them somewhere (or you could write something to get them yourself)
Dave.[/B]


 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well, if you have the data in a form it will get converted automatically, but I don't have a book handy at the moment to see if there is an automatic javascript way...

This is only way I'm aware of getting the automatic character conversion.
 
hemant singh
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
even if i dont do anything with the generated URL and click over it , the queries are passed at the back end but when i do request.getParameter() , i get only those characters before #...thats the problem.so is there any way to retriev the value available in the query

Originally posted by David O'Meara:
[B]well, if you have the data in a form it will get converted automatically, but I don't have a book handy at the moment to see if there is an automatic javascript way...

This is only way I'm aware of getting the automatic character conversion.[/B]


 
reply
    Bookmark Topic Watch Topic
  • New Topic