• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to display source code in browser?

 
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well this question is repeated here in forum a lot of times but I have never got satisfactory reply. may be because I did not frame it properly. Lets try one more time. So here goes my question:

I want to show java, xml or whatever; source code in my jsp pages to user, means in the browser. I have seen in many blogs, jForum and now in coderanch that whenever we make use of code tags the code taking a very good formatting and style. Is there any open source libraries available to achieve this?

Waiting for a positive response.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's no secret to it - JForum (and numerous other sites) use the http://code.google.com/p/syntaxhighlighter/ library, which uses a combination of JavaScript and CSS to achieve its magic. If you examine the source code of a page that has a CODE tag you'll see it in action.
 
Himanshu Gupta
Ranch Hand
Posts: 598
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ulf. Let me try this also. Really happy to get a prompt reply as expected here.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic