• 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

as it happens in ASP

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been working with ASP, and now learning JSP. I could not find alternative methods as in ASP:
<em>Server.URLEncode</em> and
<em>Server.HTMLEncode</em>
Thanks
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The foolowing code is an implementation of the HTMLEncode function that ASP has:

Hope this helps.
Regards,
Kavita.
[This message has been edited by Frank Carver (edited November 29, 2000).]
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Two things to note when posting code to this board:
1. Please put UBB CODE tags round your code to preserve the formatting.
2. If you use HTML escape sequences in your code such as > they will be converted to the equivalent characters when the page is shown, which will probably mystify readers. To force the board to show &gt; you need to type &amp;gt;.
I have edited the above example to do this, but everyone should really be aware of these issues when posting code.
[This message has been edited by Frank Carver (edited November 29, 2000).]
 
Frank Carver
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For interest there is another implementation of this same function in another thread here.
 
Ranch Hand
Posts: 126
Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I can find all the special characters taken care of. But m not sure that is this list complete ??
Regards,
nitin
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's doing it the hard way! Sun already provides a URLEncode method.
for an HttpServletResponse object, invoke:
String encodedURL = response.encodeURL( originalURL );
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic