This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Not encoding the URLs  RSS feed

 
John Paterson
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys...

How do I modify a URL encoding code to one that doses not encode the URL? For an example, how do I modify the following line of code such that it does not encode the URL:



Hope someone can advise. Thanks.

regards
John
 
Junilu Lacar
Sheriff
Posts: 11128
160
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you want to do that? The JavaDocs for encodeURL say:

For robust session tracking, all URLs emitted by a servlet should be run through this method. Otherwise, URL rewriting cannot be used with browsers which do not support cookies.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66184
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, you should no longer be using Java scriptlets in JSP pages. Please read this JspFaq entry.

Secondly, if you don't want the URL encoded, why are you calling the encoding method?
 
John Paterson
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys...


I underand that using scriplets may not be 'best practice' anymore. I am picking up Servlets and JSPs, one of the exericies I was doing required me to do the above and I wasn't sure how to do it, hence the post. I thought since I am learning, I should get a hang of how these things are done, even though such a procedure may not be common practice anymore. Thanks.

regards
John
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66184
146
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can never understand the attitude of "I'm just learning, so I'm going to learn how to do it wrong first."
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!