views:

124

answers:

5

which one is better? i want to make web based application , new to Java world but not to the programming.....

A: 

If you are new to Java, you should start with JSP for a web-based application.

Freemarker can be used to generate HTML pages, but is more known for document generation (ODF files, RDF files, etc.).

After a little practice with JSP, you'll have to look for web Frameworks (Struts and JSF are the major ones). There is a lot of tutorials on the internet about Java web programming.

Benoit Courtine
A: 

A lot of people will suggest you with freemarker (advantages), its quite mature, but I'd use jsps, if your application is not too complex, I'd suggest you to take a look at the new jsp 2.1, Its come a long way.

Few advantages (JSP): - Its quite easy - It comes bundled with a servlet container - No need to add extenal dependencies - Lots of tutorials available - The new version has a lots of useful features (functions, easy way to write custom tags, etc.)

For more advanced features, like templating, code generation, freemaker seems be the choice among people.

naikus
A: 

Yes, JSP is OK to generate dynamic pages, but if you want to generate e-mail contents based on a template, you will end up using freemarker (or xslt or velocity) as well.

Maurice Perry
Thanks everyone. i am now also looking at GWT, i think uwing GWT makes things simpler and faster
Saket Bansal
A: 

One of your tags should be Struts not struct. JSP is the standard Web templating language in Java: JSP. However FreeMarker and Velocity, especially Velocity, forbid intermixing business logic with presentation logic. I recommend you to go with JSP first. It is now a very robust and complete framework. If you didn't like it, then you can try Velocity and FreeMarker.

Bytecode Ninja
+3  A: 

In FreeMarker Faq there is a FreeMarker vs JSP comparison.

From my experience with JSP is very easy to mix business logic inside the presentation layer, breaking the MVC architecture pattern. Making applications where the View is isolated from the other application parts is a desired thing.

It's true that JSP has lot more tutorials and documentation and the community is bigger, but it's not hard to follow the FreeMarker's documentation.

I can't say about the others templating engines because I don't know them, but I think Velocity may be a good option too.

I recommend using FreeMarker (or another templating engine) instead of JSP.

Daniel Moura