tags:

views:

36

answers:

3

I want to print some java, jsp code on webpage in an indented format.

Is There a tool that would do it, right now I have to use &nbsp, &lt, &gt to get it done, which is very painful

+2  A: 

You could just use the <pre> tag...

Justin Ethier
and escape the < and > characters
M28
A: 

If you have access to a text editor, you could just use "Find & Replace..."

Just replace:

  • < with &lt;
  • > with &gt;
  • (two spaces) with &nbsp;&nbsp;
George Edison
Thanks for the response, but the pre tag seems to be a lot simpler
A: 

You would have to find the dynamic way of storing and printing the text for example with the combination of javascript and php you can easily achieve this with the help of free and open text editor like WYSIWYG Editor

Have a look at this URL : http://www.openwebware.com/

this can provide a complete solution to you. and embedding on your website should not be a problem, just google something like embedding WYSIWYG Editor etc. you can always find many good tutorial that explain step by step how to do this..

hope this helps you..

Ibrahim Azhar Armar
Thanks for the response, but the pre tag seems to be a lot simpler