I have been using PHP (OOP) with various Frameworks for all my webdevelopment projects for the last few years. Next year I'll have to learn Java as part of CS university course, so I thought it may be a good idea to switch to Java for some of my smaller webdevelopment projects, so that I can get to know Java in advance.
What do I need to use Java for backend web development? What IDE/Server software/etc. should I use? What frameworks are available and which documentations could one recommend?
I know this is strictly not a Stackoverflow question, but I'd really like to hear the opinion of the very professional community here at Stackoverflow!
The web development component of Java is called Java EE. You should look into that.
As IDE you can use Eclipse, Netbeans, etc. (you can download versions that are specifically aimed at Java EE development, with bundled servers like GlassFish or Tomcat).
Use all of these technologies and learn what the terms mean: Servlet, JSP, JSTL, Filter, Tag library (create your own).
A very popular framework is Spring. Spring Core and Spring MVC has recreated most of the Java EE components but in a way that is easier to use.
The DWR library makes AJAX very easy.
Learn how to use Spring ORM, Hibernate or JPA.
I also just want to add my own answere to show what I choose in the end to work with:
IDE: NetBeans
Framework Play! Framework
Related
We've got an app that needs to run in a Java app server. I've got to develop a webapp to go with it. I've started reading about Ruby on Rails, and I really like the approach: MVC, convention over configuration, tons of stuff taken care of for you.
I may be dreaming the impossible dream, but are there any Java webapp development frameworks out there that work in a similar way?
Straight JSP is miserable, because logic and presentation are mixed. Simple template systems, like Velocity and Freemarker don't do the database stuff. I don't know much about Spring.
Everybody here knows Java, and we don't have time before the next release cycle to learn an entirely new language and library, else I'd plunge into RoR in a serious way.
Not impossible at all. It's already been done.
Here are a few Java-equivalents:
Grails http://www.grails.org/
SpringRoo. http://www.springsource.org/roo
Spring MVC. http://www.springsource.org/
All are products of SpringSource. If you're getting serious about Java web development, I highly recommend you check them out.
Grails was actually inspired by Rails, hence the name, so you'll see many similarities in features and paradigms between the two, including MVC, convention-over-configuration, and code generation. So if you're looking to get right into Rails-like development in Java, I highly recommend Grails. I should note that Grails has more features than Rails, some of which I think Rails should adopt. An example is Grails provides a service layer to handle all business logic. You could easily implement a service layer in Rails, but its convenience we all love, and because Grails includes it, it is more convenient. I've hopped between Rails and Grails once upon a time, both great frameworks.
Keep in mind that you can do Rails development with Java as well, via JRuby, which is not a bad option either. You get all the features of the Ruby language (v. 1.8), along with the ability to integrate and use Java libraries within your Ruby code.
SpringRoo is SpringSource's new code generator framework, so you can use it with the Spring framework to aid in agile/rapid application development.
Grails is actually built on-top of the Spring framework and Groovy. Groovy is Java-derivative which looks more like a scripting language and provides all the meta/dynamic programming goodness that you see in languages such as Ruby and Python. However, Groovy allows you to write Java code as well, so there's no need to learn it, not entirely at least.
Have a good look at the the Play Framework. I think that it's the best way to develop Java web applications at the moment. Certainly the quickest. There is no deploy cycle. Save the code and refresh the browser.
It comes with Hibernate and a host of enhanced functionality that streamlines the development process. Totally REST based and stateless.
Add in jQuery and it feels like web heaven.
I'm a beginner coding a Java web application. I used to code Ruby On Rails.
Can you recommend a standard, cool environment for Java web application coding? Is Java+Tomcat+Struts+Eclipse standard?
I would say your choices of Java (duh), Eclipse (Netbeans is also a viable option for IDE) and Tomcat are pretty non-controversial.
Struts was a good framework for MVC web applications, but I think it may be a bit dated these days - Spring seems to be the primary heir apparent in that category. However, if you're jumping onto a whole new language and platform I would suggest leaving an MVC framework out of the mix at first and just coding basic servlets or JSPs by hand. Once you have those basic technologies down, then you can get into fancier frameworks.
I was thinking which framework would be a good choice to go into. I'm focusing on java apps and tested spring, grails and seam so far. I've also looked aboard java and gave ruby on rails a try too.
In future I will be focusing on portlet development which I've gone through already without a complete framework (just hibernate).
Maybe someone could share some experiences? Or point me to a corner which I don't looked in so far?
Regards and thanks for reading ;)
If you're doing this out of curiosity and to learn something new, rather than to meet specific requirements for a specific project, maybe you'll enjoy the Play! Framework. It contains a lot of stuff from other frameworks and is designed to get you up and going very quickly, with short development cycles and not a lot of arcanae.
Their stated purpose is to be "by Web developers for Web developers". They intend to put the fun back into Web programming.
This sounds good and I've read a few nice things about it in fora and blogs, but I haven't tried it myself yet so that's all the recommendation I can give.
Grails has a plugin for developing portlets, described here.
If you consider Groovy or Grail, you might consider ZK, too. It is an Ajax framework integrated well with Groovy and Grail.
I'd say you go with a framework that targets the programming language you're most proficient in. If you already are good in Java, and you're a quick learner ( to learn Groovy ), Grails could be a good choice.
If you'd like to go with another scripting language, say Ruby/Python, then choose Rails or Django, or Pylons ( the list could go on here ).
If you're going for a Java only framework, I'd go with Spring MVC.
You should have a look at the play framework (SO question).
Finally a Java framework made by Web developers. Discover a clean alternative to bloated enterprise Java stacks. Play focuses on developer productivity and targets RESTful architectures.
I was thinking which framework would be a good choice to go into. I'm focusing on java apps and tested spring, grails and seam so far. I've also looked aboard java and gave ruby on rails a try too.
FYI - Grails is using Spring and Hibernate underneath; SEAM uses JSF and Hibernate.
Grails is the Java equivalent of RoR. It's based on the same idea: "convention over configuration".
It's also important to be clear that Spring is far more than a mere web MVC framework. It's based on DI and AOP and encompasses persistence, remoting, enterprise services, etc. It supports portlet MVC, which is a plus given your requirements.
Personally, I would recommend straight Spring over any of your choices so far if you stick with Java. It's important to know something about what's going on under the covers. If you know Spring well, Grails will be easy.
I'd use Wicket rather than Play! because Play! requires Python as a semi-dependency. With Wicket, you only need Apache and Java and thats it.
I suggest you also check out here:
http://gokhan.ozar.net/best-java-web-frameworks/
I am a .NET / C++ programmer switching to Java. I had previous exposure to Java 10+ years ago in university.
What would be the typical things to be learned in order to be able to program web applications in Java?
I can think of:
JSP/Servlets
Eclipse
EJB
What else do people use these days?
The idea would be to be able to land on a Java project and make myself useful
Hibernate and Spring
I migrate between a lot of clients who use Java heavily. Here's what I see people use:
a) a lot:
JDBC
Servlets
Ant
Log4J
Eclipse/Intellij
b) quite often:
JSP
Spring
Maven
Web Services
the Apache Commons libraries
c) barely ever:
EJBs (not since 2002 or so!).
I've not come across Hibernate or other ORMs. I'm not sure why, I confess, since it seems popular in the context of SO.
Tools department:
Eclipse and Netbeans
(For web-centric Java development, see the Eclipse based Aptana IDE)
If you are focusing on web applications specifically, it's important to know and understand many topics that are independent of Java:
JavaScript
SQL
CSS
XML (XPath in particular)
HTML
HTTP
You need to get a grasp of these concepts before learning Java frameworks that may or may not simplify the creation of code dealing with them.
As far as Java-specific libraries and frameworks go, these are essential:
Servlets and JSPs
JDBC
Ant
Apache Commons -- for the love of all that's good, don't re-invent common libraries!
These are nice to have but are too narrow to focus on before learning everything above:
Spring
Hibernate
Maven
JSF
Grails is also a Java platform web application framework, although it's coded in the Groovy language rather than Java, which is more like Python or Ruby and is dynamically typed.
It is based on the Project and Company, i am writing few tools/framworks which i came across
IDE :
Eclipse
Jboss developer
Ibm Rad
Spring tool suit(sts)
Repository
Svn
Smartsvn
tourtoise
Git
Built Tools
- Ant
- Maven
Presentation
-Html, javascript, jquery, ajax
-Html with jsp
-Html with Struts tags
-Html with Spring tag liabaries
Controller
-Servlets
-Struts
-Spring
Business
-Ejb
-Spring
Database
-Jdbc
-Spring
Other
- WebService - Soap , Rest
- Putty
- FileZilla
- log$j
- Mokitio
- Junit
I have pretty big background of .net, and I've decided that i want to port one of my websites to Java. (now with the asp.net MVC craze, I've figured I'd better learn a more mature approach to MVC).
i've downloaded eclipse (easyeclipse distro to be exact, and am ready and willing to develop my first website in java).
i've programmed j2me application before, so i know the language and some of the framework.
can someone guide me? any advice?
Although I'm not very aware of "asp.net mvc" is all about, I would suggest you to take a look at Spring it may be interesting.
Probably is too complicated at the beginning but when you get the concept it turns out very easy to follow.
Spring has 5 core modules ( which I don't remember exactly ) but they were like:
AOP
ORM
MVC
Core
( some other I'm missing here )
The MVC part uses a lot of annotations to make life easier. There's a very big community around Spring.
Here's an introductory article about spring.
Java has a ton of frameworks you can choose from. The technology stack that I use for my Java development is either:
Spring for IoC.
Hibernate for the data layer.
Struts2 for the MVC framework.
I have also swapped out spring and used Guice for the IoC.
Spring also has MVC, but I tend to like Struts2 better.
I'd recommend looking at Grails, it lets you become comfortable with all the java libraries and frameworks like Spring, SpringMVC, Hibernate, SiteMesh, and so on but gives you a much better DSL for web applications and much more concise code with the Groovy language (think of it as Java with dynamic typing, blocks, closures, and so on).
If you'd rather stick to pure Java I'd recommend looking at the Stripes framework and the following book:
http://pragprog.com/titles/fdstr/stripes
If you interested in web applications specifically, I would recommend using MyEclipse http://www.myeclipseide.com. Basically, this is a version of eclipse with all the web server integration and functionality built in. I've been using it for a few years and it's much easier to develop with than with plain vanilla eclipse. Depending on how much your going to use it, you have to decide whether the $55 annual subscription is worth it for you.
I'm a little confused. does spring framework actually a full blown framework? doesn't Java already have a framework? (by framework i mean all those misc libraries).