wood burning stoves
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 Make it so: Java DB Connections & Transactions this week in the JDBC 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('voirDetailsJour.do?usineSelect='+ 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(\'voirDetailsJour.do?usineSelect=\'+ 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: http://aspose.com/file-tools
subject: having a character " ' " in the url of a href in jsp
It's not a secret anymore!