jQuery in Action, 3rd edition
The moose likes JSP and the fly likes c:param manipulations in jstl Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "c:param manipulations in jstl" Watch "c:param manipulations in jstl" New topic

c:param manipulations in jstl

Khushwinder Chahal
Ranch Hand

Joined: Oct 03, 2007
Posts: 128
Hi All

I have the following code for print button.

And the javascript function is like this
function mypopup(url)

But i am getting a problem here.
If my codename contains apostrophe(') i get a browser err that my url contains apostrophe(') in query string. And this err comes on the javascript functions's first line i.e. function mypopup(url) this one.

For removing this err i have to pass the codename such that it should not contain any apostrophe(').
Anybody has any idea how to replace it so that my query string does not get effected.

Thanks in advance.
[ December 04, 2007: Message edited by: Bear Bibeault ]

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

"khushwinder khushwinder", you have previously been warned on one or more occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.

Your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Be aware that accounts with invalid display names are disabled.

JavaRanch Sheriff

[Asking smart questions] [About Bear] [Books by Bear]
Khushwinder Chahal
Ranch Hand

Joined: Oct 03, 2007
Posts: 128
Hi Sheriff
Thanks for your information.
But tell me one thing... am i going to steel from your forum with my name???
I can not understand your policies.
You do not know the naming conventions in whole world , its clear.
Then why are you making rules.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

If you would like to complain about the naming policy or its enforcement, please use this forum. The JSP forum is for JSP discussions only.

Thank you for changing your screen name.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

As to your original question.

Anytime you have text that's going to be used in Javascript code, it is a good idea to escape control characters before passing to the JSP.
These include single quotes, double quotes, and back slashes.
I agree. Here's the link: http://aspose.com/file-tools
subject: c:param manipulations in jstl
It's not a secret anymore!