Take HTML code, inject it into standard Java println statements
Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.settings
src
war
.classpath
.project
README.textile

README.textile

Java HTML Injector

Injecting HTML in a Java Servlet can be quite a pain. With this tool, you can just write your plain HTML code from start to finish. Once you’re done, send it to this tool, and copy the result into your Java source code.

It will take basic HTML code and wrap each line in “out.println();”. For example:


out.println("<ul>");
out.println("<li id="active">");
out.println("<a href="/index.html">Home</a>");
out.println("</li>");
out.println("<li>");
out.println("<a href="/resume.html">R&eacute;sum&eacute;</a>");
out.println("</li>");
out.println("<li>");
out.println("<a href="http://www.aaronfoltz.com/blog">Blog</a>");
out.println("</li>");
out.println("<li>");
out.println("<a href="http://www.aaronfoltz.com/wiki">Wiki</a>");
out.println("</li>");
out.println("<li>");
out.println("<a href="/list.html">IT Company List</a>");
out.println("</li>");
out.println("<li>");
out.println("<a href="/projects.html">Projects</a>");
out.println("<ul>");
out.println("<li><a href="#">Taskify</a></li>");
out.println("<li><a href="#">Spotify.fm</a></li>");
out.println("<li><a href="/htmlinjector.html">Java HTML Injector</a></li>");
out.println("</ul>");
out.println("</li>");
out.println("<li>");
out.println("<a href="/contact.html">Contact</a>");
out.println("</li>");
out.println("</ul>");

When coding the HTML, you do not need to worry about whitespace. This means that if you indent your HTML naturally, you’re still good. This tool trims all leading and ending whitespace from each line.

About me

Email me: foltz.aaron at gmail.com OR aaron@aaronfoltz.com
Follow me: @Aaron_Foltz
Visit me: Aaron Foltz