Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to read # in input values in doGet

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

I tried reading a # in the input values and unfortunately it doesnt get picked up..

http://localhost:8080/test/test?test=123#¶m2=67#89

in my doGet method, i tried reading the value as



Result is

123
null

Why cant we read the # in the value?

Regards



 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is because # is a special character for html anchors.
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


But is there any way i can read the value as is apart from any encoding the char...



 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64827
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Encode the URL properly or it won't work. It's as simple as that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic