views:

160

answers:

4

I've been introduced to this wonderful project, xhtmlrenderer; the flying saucer project. Problem is, is that where I work, it's strictly a microsoft shop and I haven't done any java development since college, and a smidge of WebSphere a few years back.

I was wondering what it takes these days to do java development? I set up a quick proof of concept to see if I could do what I wanted with this project and it works great, however, I used jnbridge whose licenses are a bit on the expensive side but Visual Studio was what I had handy and got the job done with an hour of finagling.

I'm wondering what it take to do java development these days? Are servlets still the norm? Is Apache where I should start looking to get a small web server up and running? Is Eclipse/Ganymede the IDE to use?

Essentially what I want to do is pass a url to the service and have it spit back out a PDF. Just on vacation right now, and stuck on dial up, but can't stop thinking about this.

Thought I'd post these thoughts now to see if I can get a jump start on next weeks work.

+1  A: 

Java's not all that different, although generics add some excitement; PDF with iText is fairly straightforward; and the IDE world is pretty much the same as ever. Eclipse and Netbeans are common, there are several others, and real programmers still use EMACS.

Apache is pretty generic, but with servlets in mind you might think about Tomcat.

Charlie Martin
am i going down the right path with servlets, or would you suggest something else that i might be unaware of?
Dave
If Servlets serve your purpose, then there is nothing wrong with them.
Eddie
It's hard to answer without knowing more about your application, but generally servlets are about as simple and effective a way to do Java web apps are any.
Charlie Martin
http://server/convert?url={valid xhtml 1.0 strict document} ==> {valid xhtml 1.0 strict document}.pdf
Dave
Honestly, I'd be tempted to just use a generic CGI program. Prince and Sphinx will do a nice job of transforming XHTML to PDF, and the CGI can be something really exciting like a three line shell script.
Charlie Martin
Oh, duh. You have the rendering part. So, yeah, a servlet will do fine, but since you can run this as command line java, you could also write a short script.
Charlie Martin
Prince and Sphinx? I've never heard of them, can you provide links please? Google isn't being particularly helpful. Thanks
Dave
Found Price, but looks pretty pricey for the amount of use I believe I'll get out of what I want to do. Still looking for the Sphinx
Dave
Found Sphinx http://sphinx.pocoo.org/ i think and this is Prince I think http://www.princexml.com am
Dave
Thopse are the ones, but honestly I think your renderer looks pretty good. I'd never seen it before.
Charlie Martin
+1  A: 

If you want a small enough web server, you can always use an embedded Jetty. If you need the full services of Tomcat, it's also available. For Java development, I use Eclipse for an IDE. Not only is it free, but its support of refactoring is ahead of Visual Studio. Actually, if you used the WebSphere development environment, then Eclipse will be very familiar.

Eddie
+1  A: 

Eclipse is certainly the IDE on no budget, NetBeans is also free. I prefer IDEA from Intellij, but for something that sounds like such a side part of your project, it probably isn't worth the money.

In terms of servlets, etc., it really depends on the archetecture/scalability you are looking for.

If you are looking for something that needs to run as a small web interface, then something like Jetty or Tomcat with a basic servlet should be fine.

You might be looking at something invoked via the command line, although starting a JVM for every conversion is going to be too heavy for all but the most trivial usages, but a little program that monitors a directory and pulls stuff out of it for the conversion may be what you need.

If you give more details about the archetecture and how you are planing to use it you could get some more specific advice.

In general .NET and Java development are quite similar (.NET was started to compete directly with Java, after all), but the real practical difference is that a lot of the .NET environment is kind of provided to you on a silver platter. You need a web container, you have IIS, you need a database, you have MS-SQL, You need an IDE, you have Visual Studio, etc., etc. In Java development, these are all choices to be made, there isn't really a default obvious good choice for a lot of things - there are many competitors. That can create a larger curve for a Microsoft shop than you are expecting.

Yishai
I'm just passing a url which points to a valid xhtml strict document, in turn that service will return a pdf document on demand. I expect usage to be light. The project pulls the related content, including images and stylesheets, all I need to do is get the url to library and it gives me an outputstream with a pdf in it
Dave
@Dave, sounds like a servlet is good fit for such a scenario.
Yishai
Good answer. I never before realized that Microsoft development was so Pythonic: there is one obvious way to do it, eh? Is the platter really silver?.
Glenn
@Glenn, well, relatively speaking.
Yishai
+1  A: 

Consider sneaking in IKVM (http://www.ikvm.net/) as it allows you to use Java components in a .NET environment.

Thorbjørn Ravn Andersen
Thanks, think I'd seen this before but had forgotten about it
Dave