This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes having a character Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "having a character " Watch "having a character " New topic

having a character " ' " in the url of a href in jsp

Harish Muthuraman

Joined: Jun 10, 2010
Posts: 11
<a href="#" onClick="javascript:actionClick(''+ document.forms[0].usineSelect.value+'¯ozecSelect=1&autreMacroZecValue=<bean:write name="SYN" property="labelSyn"/>');"></a>
suring runtime <bean:write name="SYN" property="labelSyn"/> value becomes "STN'STB".
when ever the value contains an appostrophe, my link does not work.
please help

With Regards
Harish M
Sunny Bhandari
Ranch Hand

Joined: Dec 06, 2010
Posts: 448

problem is not ' but ". your link is malformed

<bean:write name="SYN"

The first " marks the end of " in onClick="javascript:actionClick

see if the link given below works for you.

<a href="#" onClick="javascript:actionClick(\'\'+ document.forms[0].usineSelect.value+\'¯ozecSelect=1&autreMacroZecValue=<bean:write name=\"SYN\" property=\"labelSyn\"/>\');"></a>

Java Experience
zohaib shiekh

Joined: Apr 03, 2011
Posts: 4
bean tag in using with java script will not work but some time worked
your are through is value using request and get get on page
Harish Muthuraman

Joined: Jun 10, 2010
Posts: 11
@ Sunny Bhandari
Thanks for your reply.
But again same link works when the bean write's value doesnot have an appostrophe in it. So, i don't think the double quote is the problem.
I agree. Here's the link:
subject: having a character " ' " in the url of a href in jsp
Similar Threads
Java Script not working in firefox but working in IE
function of Javascript in Struts is not working
help :how to get value from logic:iterate
Iterate Hashmap through struts
usage of <html:link> tag