${viewWPMasterGrid.name} retutrns me a string(for e.g. W.P.WINT OFF ALL’10) which often has single quote character so from the calling javascript method I am not getting the second parameter at all. How to deal with problem?
You’ll need to escape the output.
I’m not sure how to do that in Java (I don’t speak Java), but Googling for ‘jsp escape javascript’ should help you along.