Abhinav
Abhinav

Reputation: 1091

Write html code to JSP through JSP write

Hi i am generating dynamically html code and trying to write that code to jsp code. but i m not able to write it. Although it write same code if i put in into double quotes passed it as argument to jspwriter. example :

pageContext.getOut().print(sbCutDetails.toString());

this is not working

pageContext.getOut().print("<td  width ="368.24646" id='0'  title="INSERT MACRO SLICE_0" bgcolor="WHITE" onclick="javascript:showMacro('null','111.0','22','0','111.0','0.0','0')">&nbsp;</td><td  width ="331.75354" id='1'  title="ADD MACRO TO BOTTOM_0" bgcolor="WHITE" onclick="javascript:showMacro('Edit Cut','100.0','12','1','100.0','111.0','0')">&nbsp;</td>");

it is working.

Upvotes: 0

Views: 968

Answers (3)

Viral Shah
Viral Shah

Reputation: 2246

you can check by using <%jsp:usebean ... %>

Upvotes: 0

coffee_machine
coffee_machine

Reputation: 1223

If sbCutDetails is a StringBuilder and you did append the same text to it, it should produce the same output.

Upvotes: 1

Viral Shah
Viral Shah

Reputation: 2246

I think jsp scrip-let you need to use this time for dynamic binding "<% ... %>" with simple HTML tags.

Upvotes: 0

Related Questions