Code Formatter: cleaning up horribly formatted jsp code [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
So I am working on a jsp/servlet that came to me and I'm looking at the jsp file and it is just a jungle of jstl tags, java code and html thrown together. At first it looked like someone ran the standard eclipse formatter on it and had the page width set to 40 so alot of stuff is broken up, I tried to format it with a larger page width but that seemed to make it worse to the point of not being able to tell what is going on without formatting parts of it first.
Anyone have any luck with any jsp/code formatter?

Are you using Eclipse WTP plugin? If not, take a look at it - it has quite a few ways to customize formatting of JSP.
If you are, JSP formatting can be customized under Window -> Preferences; Web -> JSP Files -> Editor; note that there are two separate links there - for XML and HTML JSP.

Netbeans does a decent job at formatting my jsp code. You could download Netbeans 6.5.1 and format the files in there.

I know that this question is for JSP, and not javascript, but this works pretty well all the same: http://jsbeautifier.org/

Use this to format any HTML,JSP or any other language tag: https://www.freeformatter.com/html-formatter.htm

Try maybe IntelliJ IDEA. I can't guarantee it will do the job better but it won't hurt to try.

This seems to work fine for mine JSP and JS code (free at the momenti'm using it)
http://www.danstools.com/javascript-beautify/

Related

Eclipse Plugin for internationalization i18n testing [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I was wondering if any of you knew of eclipse plugins that scan your code for internationalization issues? Things like embedded strings or locale-sensitive methods.
I looked on google and there were alot of articles on HOW to internationalize an eclipse plugin but none that support it.
Thanks in advance!
I believe internationalization is a complex issue, and every language/framework/you-name-it which deals with i18n does it differently. So, my guess is there is no such plugin, and will not be in the near future.
The only plugin I found is Eclipse I18N Properties File Editor which addresses a specific file type, but chances are you don't need this one in particular.
The closest you can get in Java is with the help of below tools
getext-commons - it can help you in Easy extraction of user visible strings etc
JRC Editor - it can help you in managing resource bundles. For e.g. it can tell you if a given key has translation missing for any supported locale of your application
Although this is an old question, thought to share TapiJI as a good option in case someone is still searching
https://code.google.com/a/eclipselabs.org/p/tapiji/

Maintaining multiple forms of user guide for a Java application [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I have a user guide for my application that I would like to provide both an HTML verson and a PDF version (and possible some other indexed version for a Java help). Are there any tools, preferably for maven that I could integrate into my build cycle that will convert from HTML to PDF? Currently I have a word doc format that I manually convert to PDF (and no HTML version available), which is prone to errors and really just a pain.
Well, after a short search, I went on http://www.xhtml2pdf.com/ and if you have your HTML, it does the trick.
However, I prefer using a wiki for documentation. It has all advantages, since it can be edited in parallel, in multiple languages, and a lot of them have both static HTML export and PDF export.
I should recommend you Dokuwiki (and you can find your plugins at http://www.dokuwiki.org/plugins) because it's really easy to install and administrate, but you can also use any other one that have PDF and HTML export.
You might use a tool like DocBook and write the documentation in a scripting language (XML in their case). Then use the tool to transform the source to the target formats, e.g. HTML and PDF.

Java - converting html with images in CSS to pdf [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am looking for a free java library to convert html to pdf. Html page is formatted with CSS, and those styles contains images (.gif). At the moment I am using Flying Saucer but this library cant convert CSS with images properly.
Thanks in advance.
Marek
I use YAHP.
http://www.allcolor.org/YaHPConverter/
It does have CSS. I have had issues with some CSS styles, such as the roundborder ones specific to chrome/firefox, but it does have CSS. I can't remember ever having a problem with CSS images.
one lame way (but hey you may be desperate) is there is a java library for contacting openoffice running as a headless server. This is http://www.artofsolving.com/opensource/jodconverter ... and use openoffice to convert. OTOH, this is pretty kludgy, and definitely not pure java) and I'm not sure how good the openoffice html import filter is ... but I guess it's worth looking at. There used to be some html to pdf converters built into iText but they have been removed (and were pretty limited).
Try this HTML to PDF converver: http://pd4ml.com/index.htm. It's writen purely in Java
Try the Adobe -Generate PDF API (Java)-- http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/wwhelp/wwhimpl/common/html/wwhelp.htm?context=sdkHelp&file=000447.html - here you can see the how to, and at the bottom, a quickstart which contains working sample java code to convert a web page into PDF.
Prince XML is the best and easiest to use PDF generator I've used. A commercial license costs a pretty penny, but if you're OK with a small watermark on the first page of your document, the free version is great. It can be integrated with a number of programming languages, including Java.

Java: GUI component for displaying diffs? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm writing a programm in which I need to generate a diff and display the result. Is there any GUI component out there, with which I can easily accomplish this task, or do I need to hack something for myself?
I'd prefer using a Swing component, but any other technology will be fine, too.
There is a diff tool available if you are building on the NetBeans platform.
If you can't use that, I don't think it would be difficult to create a basic one that uses HTML in a JEditorPane to display the results.
As far as i know there is no component for this. Any modern IDE does this job today, also source control plugins have this function, many of them are open source so you can get the idea by viewing them. But it would be hard.
#madlep has a solution with Difference algorithm for Java check this topic:
Generate formatted diff output in Java
Take a look here .
I used Diff.java to create a JPanel that will show the differences between two files.
Hope it will help !
Maybe have a look at the JDiffPlugin for jEdit (it might be easier than digging Eclipse / NetBeans / IntelliJ source code).
Or have a look at the Java diff viewer Component? thread, it seems that someone had similar needs and you will find a solution based on incava.org's Diff implementation (the location of sources changed so I'm putting the new location below):
(For the Diff sources)
http://dawes.za.net/gitweb.cgi?p=rogan/webscarab/webscarab.git;a=tree;h=148dc26a7ff3ef6ff5ddc35b206
(For the DiffPanel sources)
http://dawes.za.net/gitweb.cgi?p=rogan/webscarab/webscarab.git;a=tree;h=f6b756fbe78c6f1be21a00cffbe
I know IntelliJ IDEA can do this, and they've recently released an open-source community edition, so the code is in there somewhere. It will probably taken a bit of digging to find the relevant code though!
check here
and The code is all available here (via GIT or on the web):
https://github.com/albfan/jmeld
JMeld, A visual diff and merge tool.

What is the best free plugin for Eclipse that allows for formatting/indenting/cleanup of JSP code? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I know that IntelliJ has an option to select all the code in a JSP file, right click, and select "format". This nicely formats all HTML, CSS, scriptlets and JSTL tags in a JSP file.
Can Eclipse do this?
If not, what is the best free Eclipse plugin that does the same?
With the Web Tool Plateform plateform (on eclipse.org website), this is very simple : in the JSP editor tab, right click->source->format (or Shift+Ctrl+F)
I use the EclipseHTMLEditor from Project Amateras. Be sure to set "Amateras JSP Editor" as default editor for file type "*.jsp" in Window > Preferences > General > Editors > File Associations.
UPDATE: As of today, March 27th 2015, Project Amateras seems stale. However latest releases of WTP are much improved and surely worth a try. Thanks to #Vogel612 for the info.
I found this one on eclipse plugin central.
Looks like an all in one kind of formatter. I haven't tried it myself but it might be what you are looking for
NXFormat

Categories