0

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.

4
  • Why do you want to do that ? and note the pattern " "" " Commented Apr 26, 2012 at 11:11
  • Hi i my application at some places we need dynamic html code,tht i m generating throguh tld ; but generated tld is tht i passed into second argument of jspwriter. when i m passing dynamic value as argument jspwriter is not able to write html code on jsp page bt when i m passing as fixed value as argument same code. it s working. Commented Apr 26, 2012 at 11:17
  • where is the code to generate sbCutDetails ? Commented Apr 26, 2012 at 11:34
  • i have not written code to generate sbCutDetails.but it is finally generates as :<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> Commented Apr 26, 2012 at 11:39

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

4 Comments

Ya sbCutDetails is a string buffet and i am appending same code tht i passed into second argument of jspwriter. but i m not able to guess the problem why it not writing html on jsp page....
do you use the code inside the JSP? in this case, simply put <%= sbCutDetails.toString() %>
no code i m generating in TLD(java file ) and writing it to jsp through jsp writer.
do you use ...getOut.append(..) ?
0

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

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.