0

I have a Java server and I have a String of a SQL query.
I want to get a string of the query in HTML (with colors like prettifier).

In the client side I used prettyPrintOne in angular, but I need to get it from the server side now.

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Your question is not very clear but if you have a SQL string available then use any api like https://google-code-prettify.googlecode.com/svn/trunk/README.html or http://www.jqueryscript.net/other/jQuery-Plugin-to-Pretty-Print-Minify-Scripts.html – Sheetal Mohan Sharma Jun 10 '15 at 14:48
  • thanks for the quick answer.. but i need to implement this with java – shiran azulay Jun 10 '15 at 14:56
  • Where do you print it in java side? In console or Java Swing pane?? – Sheetal Mohan Sharma Jun 10 '15 at 15:04
  • i need to get the html as a string in java – shiran azulay Jun 10 '15 at 15:07
  • i am adding it to a mail body (javamail) – shiran azulay Jun 10 '15 at 15:11
  • In javamail your message contains HTML markup. Send email in html format with String as html // message contains HTML markups String message = "Greetings!
    "; message += "Wish you a nice day!
    "; message += "Duke"; HtmlEmailSender mailer = new HtmlEmailSender(); try { mailer.sendHtmlEmail(host, port, mailFrom, password, mailTo,
    – Sheetal Mohan Sharma Jun 10 '15 at 15:39
  • i know, but i am asking how can i get from a sql string -> a string of the generate html (to make it look nice) ? – shiran azulay Jun 11 '15 at 06:53
  • You should be able to post the generated HTML (prettified) as a normal form parameter and consume it from the Java side as a normal HTTP request parameter (with the framework or tool of your choice). Do you already have a Java server? If yes, what framework are you using to handle HTTP requests? – Jaime Garcia Jun 12 '15 at 02:14
  • Look at this http://stackoverflow.com/q/1853419/1737819 – Developer Marius Žilėnas Jun 12 '15 at 06:50
  • i think i didn't explain my self good enough. lets say that i need to create a java function that gets a String input : (the sql query) and i need it to return the html of this query in nice colors like a beautifier... – shiran azulay Jun 14 '15 at 07:29

0 Answers0