Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm looking to start developing for the web using Java - I have some basic Java knowledge, so that's not a problem, but I'm at a loss when it comes to deciphering the various technologies for use in web applications.
What options are available to me? How do they work? Are there any frameworks similar to Django/Ruby on Rails which I could use to simplify things?
Any links which could help with understanding what's available would be much appreciated.
Java frameworks come in two basic flavors. One is called the "Action" Framework, the other the "Component" Framework.
Action frameworks specialize on mapping HTTP requests to Java code (actions), and binding HTTP Requests to Java objects. Servlets is the most basic of the Action Frameworks, and is the basic upon all of the others are built.
Struts is the most popular Action framework, but I can't in good conscience recommend it to anyone. Struts 2 and Stripes are more modern, and very similar to each other. Both are light on the configuration and easy to use out of the box, providing very good binding functionality.
Component Frameworks focus on the UI and tend to promote a more event driven architecture based on high level UI components (buttons, list boxes, etc.). The frameworks tend to hide that actual HTTP request from the coder under several layers. They make developing the more advanced UIs much easier. .NET is a component framework for Windows. On Java, the popular component frameworks are JSF (a standard) and Wicket.
As a rule, if you're creating a "web site". that is something more akin to presenting information (like a blog, or a community site), the Action frameworks work better. These sites tend to be simpler, get bookmarked often, require "pretty URLs" etc. This is generally easier to do with an Action framework.
Component frameworks are much better for things like back office applications with lots of UI elements and complicated workflows. You'll find, particularly with tooling, that these style of apps will go together faster using a component framework. But component frameworks have more complicated request workflow, sometimes relying on hidden state, lots of POST actions, etc. Many have "horrible" URLs, and sometimes create pages that are difficult to bookmark.
Both frameworks can be used for both tasks, just some are more suited to the task than others.
None of these frameworks directly address persistence, but many have extension modules or idioms that work tightly with JPA/EJB3 or Hibernate.
Your basic java web technology is servlets. Servlets let you write Java code that responds to various HTTP events (doGet, doPost, doPut, etc). They're generally used for controllers in the MVC architecture.
Link: http://java.sun.com/products/servlet/
JSP lets you write HTML with embedded Java instead of the other way around (in servlets). JSP has been extended via JSF to incorporate more recent architectural advances. This is in the same line as PHP and ASP. This is the view portion of the MVC architecture.
Link: http://java.sun.com/developer/technicalArticles/GUI/JavaServerFaces/
A lot of more complex applications utilize Enterprise Java Beans (EJB) for session management, clustering, etc. This isn't a web technology, per se, but you see it go hand-in-hand when dealing with more complex webapps. Alternatives include frameworks such as Spring.
EJB: http://docs.jboss.org/ejb3/app-server/tutorial/
Spring: http://www.springframework.org/
Also, you'll want to familiarize yourself with ORM technology (after servlets and JSP/JSF). The leading ORM framework is currently Hibernate. This lets you map SQL tables to java objects and interact with them accordingly. This is more advanced stuff so save it for when you're trying to get your head around EJB/Spring, etc.
Link: http://www.hibernate.org/
edit: I forgot to define ORM. It stands for Object Relational Mapping/Mapper (whatever version of "Map" you feel like using :)
Start with JSP backed by logic in Java classes. Or use servlets.
The advantage of using JSP and Servlets is that you gain knowledge of what all the frameworks do under the hood. And that understanding is crucial to figure out how to do X in that particular framework.
Furthermore, JSP is very easy. You can easily see what you're doing and very easily see it when you mess up the view with business logic.
And quite a lot of frameworks (Struts, Spring MVC) use JSP as their view technology. It's a natural first step in web development using Java.
I don't know if there's anything quite as nice as Django for Java, but Spring has a light-weight web framework built on J2EE
http://www.springframework.org/about
A flexible MVC web application
framework, built on core Spring
functionality. This framework is
highly configurable via strategy
interfaces, and accommodates multiple
view technologies like JSP, Velocity,
Tiles, iText, and POI. Note that a
Spring middle tier can easily be
combined with a web tier based on any
other web MVC framework, like Struts,
WebWork, or Tapestry.
something like grails ?
there is also the projects from spring
You'll need to start with servlets and JSP. There are many web frameworks in Java and all of them are based on these two technologies.
You could try Jboss Seam : http://www.seamframework.org/Documentation/GettingStarted
If you are using Eclipe as your IDE there is good integration via Jboss Tools or you can use the Seam-Gen tool that comes with Seam. This allows you to define a database table (or tables) and with a few easy commands, build an entire runnable web project from it. It's a nice way to get the ball rolling.
Also Java Server Faces
http://en.wikipedia.org/wiki/Java_Server_Faces
This is a very open-ended question. The short answer is "yes" there are frameworks, libraries and standards to do everything from writing things at the HTTP request level up to content management systems in Java.
You can also use other languages (e.g. Python, Ruby, etc) on the JVM for that matter.
For some of the Java-only technologies, investigate JSP/Servlets, Struts, Struts2 (which is the updated version of Webwork), Spring MVC, Tapestry, web4j, Wicket.
There are other frameworks built on the JVM but use languages other than Java such as Grails.
To get started I would download Eclipse (latest version) and Tomcat. Create a new web application in Eclipse. There are guides that can get you started.
Start with learning how JSPs and Servlets work, these are a bit low level and aren't really a framework, but will let you get up and running quickly. From there investigate and choose your framework.
Spring MVC is pretty easy to get set up and going. I'm certain there are others.
If you already know Ruby On Rails, you can use it with JRuby and deploy to a Java server (like Tomcat) with Warbler.
In pure Java, Wicket has a good approach and is getting quite popular.
Before studying those frameworks, why not study first where it all started? Try programming with servlets first, so you could a peek at the core of most of those java web frameworks. It would help you understand J2EE better.
J2EE is the standard. You can use this to build apps with Java Server Pages, Servlets and EJBs.
Struts is also a very popular framework that uses JSPs and Servlets. Its a bit tricky to get setup but it is a very good option for mid size sites.
http://en.wikipedia.org/wiki/Struts
In general Java is more component-based, i.e. you don't have frameworks that do it all for you (you'll probably have to pick a database access framework yourself, for example). For Data Access I'd recommend Hibernate or iBATIS.
For the front-end there are literally hundreds of frameworks around. Investigate JSF, Wicket, Struts 2, Stripes - whichever one you use depends on your specific needs as they all have different strengths.
And for a business layer I'd recommend the Spring Framework, which is very comprehensive and has a great reference guide / tutorial :)
I learned Java in college back when it was in version 1.1.5. I recently started trying to program for the web, but it didn't make sense until I read Head First Servlets and JSP. There are way more things involved in web development with Java than I ever realized, and without this book, I would have quit and just used PHP.
Related
There are so many languages in web development that sometime I get confused which one to learn and start with. I like Java, but dont like JSP for presentation, are there any front-end technologies that best suits with Java/Java EE backend for web application development?
The web-layer technology that is promoted in recent JavaEE versions is JSF. It uses facelets instead of JSP for its views.
JSP with JSTL is pretty fine though, I don't see a reason to drop it. You can use it with any web framework, like spring-mvc, struts, or other frameworks with different rendering technologies like GWT, Vaadin, Wicket, etc.
With most things it depends on what your project requires. Here are two powerful web techologies you may find useful.
Vaadin (Front and backend integrated as pure Java)
For rich, AJAX heavy applications Vaadin can be a great fit.
Advantages:
- Rapid development for complex interaction between UI components and backend beans
- Pure Java solution, no need to worry about creating markup or maintaining massive javascript files
- Good documentation
- Many powerful components out of the box and through the open source community
Disadvantages:
- There can be a steep learning curve to understand the various components
- Extending/changing some features (such as how a UI table retrieves data from a data source) can be very difficult
- If your application needs to be highly scalable, keep in mind this framework is stateful
- Handling back button on browser and dynamic URLs is extra work
Spring MVC (Front is JSP or HTML, backend is Spring MVC)
If you want to maintain total control and scalability, Spring MVC with or without JSP is your best bet. Here's a good hello world and more spring mvc tutorials are available on that site.
Advantages:
Relies primarily on open standards
Highly scalable
Helps enforce proper MVC in your code
RESTful framework, allows the developer to easily handle dynamic URLS and GET/POST separately
Retain total control by creating the HTML/CSS/JS
Note: For a HTML/CSS/JS solution, I recommend starting with something like Zurb Foundation or Twitter Bootstrap. It will save a lot of time compared to starting from scratch. Download the latest and import it into your webapp folder to get a quick boost on your project.
Disadvantages:
- Managing AJAX calls can become challenging on large applications
- A more indepth knowledge of HTML/CSS/JS will be required (compared to Vaadin)
I think Spring MVC with ExtJS is the best option as ExtJS MVC really make the code readable and easy to manage. Similarly, IC of spring MVC will also make life easier for developer. I would recommend to look into Play framework. Play for java is good but if you want to dig more then obviously it will give you hard time as it mainly developed for Scala.
Depending of the front end type you want to write, there are several options. If you can accept the style and model, have a look at SmartGWT. if you want a more GMail-like experience plain GWT 2.2 is pretty nice.
I have came from another question to this one:
How can one start with Java (JVM) ecosystem? What are beginner, intermediate and advanced knowledge-bases (bags!)? To be honest Java ecosystem was always a bit confusing to me, so it would be very helpful to provide some "reference references" and "defacto tutorials" for learning (curve!) JVM.
Note: I want to use JVM with Scala (or Clojure) but not Java itself.
I am a C# developer (WPF, Windows Forms, ASP.NET, Web Services, ... like that).
The Java Tutorial is a good place to start.
Update: you have enough questions for about a dozen posts here ;-) Honestly, you should do some research yourself (Google is your friend), then ask more specific, targeted questions; that would yield better results. (e.g. I don't think anyone can answer your question regarding Swing or JavaFX without more specific details about what you are trying to achieve.) I try to give a few pointers below, about areas I know to some extent.
for servlets and other web frameworks, here is a bunch of tutorials.
Tomcat and Jetty are both application servers.
there are a lot of different web frameworks, because different people have differing preferences, ideas and style, so many have created their own framework. It can be confusing, but at least there is choice :-)
for persistence, apart from JDBC, ORM frameworks are another strong option. I use Hibernate and I can recommend it; in a bigger project it can make your life much easier. Ultimately it depends on your specific project and constraints; there is no single right choice.
AFAIK Java has no equivalent of LINQ.
See also this post for further recommendations.
Java based web applications need to run inside of a web container such as Jetty or Tomcat.
You build your app and deploy it to the container which hosts the application at runtime.
Pure/plain JDBC should only be used directly by simple applications or integration layers that do not have access to the class model.
Most applications that I have seen have used some kind of Object Relational Mapping framework which models the entities as classes at a higher level than plain old JDBC.
Popular O/R frameworks include:
hibernate
toplink
datanucleus
cayenne
For web based development, you could start with AppFuse, see the quickstart guide.
AppFuse is a templating system that generates the skeleton of an application for you.
Then look deeper into what has been generated, and see what frameworks they are using.
AppFuse lets you choose between different technology stacks, so you could compare.
I haven't seen AppFuse support for Guice or GWT.
Guice is a Dependency Injection framework, others that could be used instead are Spring or picocontainer.
Another investigative approach that you could try would be starting with AndroMDA, which is a model driven architecture framework - you start with a UML model and then generate or forward engineer a working application.
AndroMDA also lets you control the choice of the underlying framework implementations by configuring different cartridges, once again you should dig deeper to see what they are using in the generated application.
If you are looking for a basic introduction, then the Java Tutorials are nice. To do other things like Java Web Development, then your going to need to consult google for the respective technology since they vary so widely.
One book though that I highly recommend taking a look at is Java Concurrency in Practice
Yeah, it is almost impossible for new guys to get started. This is going to drive away a lot of developers, and Java is in danger of not having constant new bloods. The old farts would love that, it's great for career security, and that's why they are making Java more and more complicated.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have some experience writing web applications in Java for class projects. My first project used Servlets and my second, the Stripes framework.
However, I feel that I am missing the greater picture of Java web development. I don't really understand the web.xml and context.xml files. I'm not sure what constitutes a Java EE application as opposed to a generic Java web application. I can't figure out how a bean is different from an ordinary Java class (POJO?) and how that differs from an Enterprise Java Bean (EJB). These are just the first few questions I could think of, but there are many more.
What is a good way to learn how Java web applications function from the top down rather than simply how to develop an application with a specific framework? (Is there a book for this sort of thing?) Ultimately, I would like to understand Java web applications well enough to write my own framework.
Update: To be clear, I am not interested in learning how to use specific frameworks (for instance, Spring or Java EE). I am looking for an explanation of the internals of a generic Java web application.
I recommend Head First Servlets and JSPs by Bates and Sierra. Some don't care for the whimsical style, but it is a solid intro to Java EE. EJB's aren't covered, but one book can't do everything.
I don't really understand the web.xml and context.xml files.
The web.xml file is just a configuration file which instructs the application server under each which filters/servlets to load and instantiate and on which url-patterns those should be invoked.
The context.xml is just another configuration file which instructs the application under each where the webapp is located at the local storage system and on which domain/URL context it should listen.
The appserver parses both files on startup and takes actions accordingly.
I'm not sure what constitutes a Java EE application as opposed to a generic Java web application.
It's unclear what your own definitions of "Java EE application" and "Generic Java Web application" are. To answer such a question (even though yourself), you'll need to lookup and/or redefine the definitions. But in general, there are two kinds of Java EE applications: web applications (usually to be deployed in flavor of WAR's) and enterprise applications (usually to be deployed in flavor of EAR's). The major difference is that the second involves EJB's and thus require to be run on an application which supports EJB's (e.g. Tomcat doesn't).
I can't figure out how a bean is different from an ordinary Java class (POJO?) and how that differs from an Enterprise Java Bean (EJB). These are just the first few questions I could think of, but there are many more.
Those are just terms which are been applied dependent on the purpose (and history) of the class in question. The term "POJO" is a (generally negative) term representing a Javabean which is just a value object (totally no business logic, pure bean with only getter/setter methods) and is generally a model object which is part of a "legacy" program which uses EJB/Hibernate. Some call it VO (Value Object), others call it DTO (Data Transfer Object), again others just stick to "javabeans".
What is a good way to learn how Java web applications function from the top down rather than simply how to develop an application with a specific framework? (Is there a book for this sort of thing?) Ultimately, I would like to understand Java web applications well enough to write my own framework.
Start with Head First Servlets & JSP. Read the Servlet API and try to implement one yourself. Knowledge of HTTP is however mandatory as well. Read/debug/play/hack the source of existing open source Servlet API implementations (e.g. Tomcat). Read/debug/play/hack the source of existing open source (MVC) frameworks (e.g. JSF). Try to understand how they works and then try to do it better. For the learning path ("What skills do I need?") I've posted a similar answer before here.
The best way to explore the Java world and to connect all the dot’s is to just use one of the frameworks, as all use web.xml, context.xml and Java EE components (all can persist the Pojo entity beans). As you already know the Stripes framework, I can recommend this book (it’s short an handles all the aspects you named):
Stripes: ...and Java Web Development Is Fun Again,
by Frederic Daoud,
Pragmatic Programmers,
ISBN: 1934356212
A more thoroughly approach for a deeper understanding of these Java EE technologies would be to gain all the knowledge necessary for passing these two Java Certification exams:
Sun Certified Web Component Developer (SCWCD)
Sun Certified Business Component Developer (SCBCD)
See the answers to this question.
Also, I build web apps with Java without using the traditional servlet-based approach at all. I generally use Restlet to build RESTful web apps which I run as standalone Java apps with embedded HTTP servers. This article details some of the advantages of using an embedded HTTP server instead of building a traditional Java web app and deploying it in a container / app server. If you're building a "regular" web application as opposed to a RESTful one (not necessary, IMHO), then check out Play, a cutting-edge high-level MVC web framework which allows for rapid development with much less ceremony.
Good luck!
If you're trying to get a good handle on what all of the bits are for in the Java EE spec and which of them you might use for web applications, I strongly suggest taking a look through the Java EE Tutorial. You can probably skip over the in-depth capabilities descriptions since you mostly want to get a high-level overview of each technology, its capabilities, and how it fits with everything else. However, do read through some of the examples that tie together the Web Tier, EJB's, and Persistence.
Get "Heads First Servlets and JSP" - it's a semi-weird looking book, but the content is excellent and people use it as a prep guide for the Sun Certified Web Component Development exam (SCWCD) for which the SCJP (Sun Certified Java Programmer) exam is a pre-requisite.
You should seriously consider getting both the SCJP and the SCWD, at least because you force yourself to get through the material. They won't guarantee to make you a better programmer than what you are now, but they will expose you to Java/Java EE material that is (usually) only available at the workplace.
I've also used some self-paced online courses with webucator.com, and I'd suggest you check their SCJP 5.0 and Web Services courses (the later similar but distinct from Web component development.)
There are frameworks out there that make Java EE web development less painful, but the more you know the guts of them, the greater your understanding of it will be (and you will be much better equipped to use it or its alternatives.)
Another book that you might want to check (perhaps you should check first) is Downey's Web Development with Java: Using Hibernate, Jsp and Servlets. It is out of print now, but there are used copies available for sale. Prof. Downey used this book to conduct a Java EE course at Florida Int. University covering the start and end of developing database-driven web applications. *
You should have some knowledge of SQL and relational database theory, even if you end up using OR mappers. This type of knowledge goes hand in hand with developing non-trivial web applications.
The irony is that the reason you want to know all about Java web development is the same reason that you are having so much trouble getting a handle on it. Why is it that every Java developer wants to write a web framework?
Seriously, though, there is an extremely long history to Java web development. From the beginning, there has been a fight between heavyweight and lightweight. It all started with EJBs and that they mostly sucked. The alternative to all that was struts. And that kind of sucked too. It all spiraled out from there with Spring bringing in the wave of dependency injection, then JSF was more complicated than ever. Finally, Rails showed up and just ran circles around everything Java had to offer. The current crop of Java frameworks show some of the legacy and battlescars of the previous generation, but it has gotten better. In general there's less configuration, and an attempt be leaner, with fewer dependencies and layers.
To answer your question more directly though, just look into the difference between a servlet container like tomcat, and a full Java EE application server like Glassfish or JBoss. It basically boils down to whether or not you want to use EJBs. If you plan on writing your own framework, you won't. Basically, just look at how servlets/servlet containers work. Beyond that, look at the source code of other frameworks.
I'm asking this question because I'm having some difficulty choosing a framework (or selection of technologies) that I can learn and use for developing a web-based UI for a small Java application:
For background information relating to the app I'm developing please read this question:
So, developing the Java application is going ok and now I'm in a position where I would like to develop a web-base UI for it.
The application and database (MySQL) currently run on a Debian Linux box, as such I've decided that it would sense to use Tomcat to run the Web App. The Web App is to serve the following purposes:
1. Manage the execution of the App by CRUDing data from the MYSQL database.
2. Display status information about the app (i.e. what orders it's placed, what orders are pending, etc.)
3. Produce on demand reports on stuff like the running profit and loss, historic and realtime prices and pricing analytics
So far so good now here's the problem:
There are a bewildering number of choices for how to develop the UI, to name a few I've looked at:
JSPs + Spring MVC
JSPs + Sping WebFlow
JSPs + JSF + Facelets
Wicket
JSPs + JSTL
etc, etc...
The choices seem endless. Is there's a clear industry standard for developing web based UIs using Java related technologies? If so what is it? Ideally I would like to learn a framework which I can use in the majority of real world jobs (and preferably one which can be used from Eclipse).
Thanks and Kind Regards
Personaly, I prefer another approach,
I would go for Eclipse of course, Spring (or other IOC container), Hibernate / JPA + JAX-RS or JAX-WS for the server layer, but not nessecarily JSF / JSP for UI.
For presentation layer, I would rather go with Flex, GWT, or a JQuery in an SOUI approach. (the service layer returns incremental updates in the form of XML or JSON, I swore not to mention the term AJAX)
Your service layer would serialize partial object graphs by demand from the presentation layer, which will act as a disconected client (work on an "offline" dataset , and update dirty on demand)
But that is just my wet dream, and in my current project I'm stuck with Spring MVC, and JSP + JSTL
I would give Jboss SEAM a test drive, just because Gavin King is behind it, but I think its JSF based.
I don't know why I don't see JSF as a SOFEA / SOUI approach, as JSF and AJAX go together well, but for some reason, JSF didn't win my enthusiasm as much as the above suggestions (Flex as a favorite)
See my related question: Web architecture: MVC, Lazy initialization, Data transfer Objects, Open Session In View, is there a consensus approach?
Is there's a clear industry standard for developing web based UIs using Java related technologies?
Well, Sun's Java EE standard is Java Server Faces (JSF) but the version 1.x of JSF is IMHO a kind of failure. This explains why they are so many alternative out there. But NO, there is no clear winner.
Ideally I would like to learn a framework which I can use in the majority of real world jobs (and preferably one which can be used from Eclipse).
Actually, Matt Raible has done very famous presentations on presentation frameworks that you'll find in Comparing JVM Web Frameworks Presentation (the latest version goes beyond Java frameworks only). Really, have a look at both of them, this is very, very good material (with real life metrics).
Personally, I'm a JSF 1.x skeptic so I would not go in this direction (there isn't lots of demand for JSF in my country anyway) but rather choose an alternative. I think that Struts 2, Spring MVC, Stripes (this one is my preferred one), Wicket (this one is getting more and more attention) are all decent choices, they'll all get the job done, the 2 first one being I believe more asked on the job market (but not the smartest). For the final choice, I'd follow Matt's advice: Eliminate, Don't Include. If the popularity on the jobs market is an important criteria, then I guess Stripes and Wicket will get eliminated. If configuration verbosity is a concern, Stripes wins. If you're looking for a kind of Swing experience, Wicket is your friend.
Now, I need to mention that the freshly released JSF 2 and CDI (JSR 299) should be a big improvement (according to the people who worked on it). As I said, I'm a JSF skeptic and I need to take a second look (because Gavin says so). But I still didn't so I can't say anything for now and I won't make any bet on the adoption and future market demand of this new version. But it's worth noting that JSF 2 with CDI should be a really new and different experience.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I've been doing PHP/MySQL web development for a while and I'm fairly competent in it. Lately however, I've learnt Java and fallen in love with it, and I'd really like to do more Java work now.
I've gotten my first opportunity with a client who needs a web 2.0ish web app built, and he has agreed to let me use anything I want to, including Java. However, I haven't done any web dev. in Java before, I've only went through the official Java tutorial, learnt a bit about applets and build a 2D pacman game, and have done some simple work in Google Web Toolkit.
I need to get started with this project in the next 2-3 days max, so I don't have much time to read long books about the topic. This is what I've learnt so far:
Setup a Tomcat on my dev machine to work with Eclipse
Learnt the basics of servlets, the doPost(), doGet() and init() methods, etc
Built a mini MVC app which displays a HTML page, lets you pick something from a dropdown and when you hit submit, it retrieves your submitted value through request.getParameter() in the doPost() function, and then forwards on to a JSP page which shows which value you picked.
I think these are the next few things I'd need to learn:
How to access/use databases
Sessions and Cookies
Possibly more about the syntax of JSP pages.
There seem to be hundreds of topics about Java web dev which I don't know anything about., but I don't have time to learn everything. I need someone to point out any other crucial things I'd need to learn, in order to build this web app (with perhaps 20 screens) using Java and Google Web Toolkit.
Also, I'm coming from a CodeIgniter background which is an MVC framework in PHP that makes things like form validation, sessions management (it uses database sessions), pagination, and common tasks like these very easy. If there is a similar, lightweight framework in Java that can take care of things like this, please mention it as well.
Thanks.
You should skip basic servlets and use a web framework, from Struts + Tiles (simple to get to grips with - a few hours at most) to Spring, etc. In your case I would also use Hibernate for database abstraction - you don't get up to speed with JDBC in such a short time.
There are so many different Java Enterprise technologies it's pretty hard to know where to start. As previously mentioned, the head first JSP & Servlets book is excellent. I currently work on an Enterprise app that was made years ago with just Servlets. We have migrated over to JSP's as time has gone on but we are not using any of the newer frameworks. So it is for sure a valid way to do it, although dated.
The thing about java, is that most enterprise development is a conjunction of a bunch of different technologies. For example, you could create an app using JSP's for the views with a Servlet back-end, using Hibernate for you DB connections, JDOM for your XML, JUnit for your testing framework, Log4j or AspectJ for your logging framework, Lucene for search, JBoss for deployment (and deployment can be pretty non-trivial) etc. etc. etc. You aren't going to go out and learn all of those technologies in the next 3 days.
What I would suggest is (as previously mentioned) to pick a framework, and there are many to choose from such as Tapestry, JSF, Wicket, Struts, etc. that will abstract away a lot of the underlying technologies. Any java technology you pick will have a good community behind it willing to help.
Another thing to consider, since you seem to be in a hurry to get things working, is that (in my opinion at least) Java is not a FAST language to build things in. It is very verbose and unless you grasp the nuances of good Java web design it is very easy to shoot yourself in the foot. Perhaps you should look at some of the other technologies that are available on the JVM (so that you have all the Java libs available) such as Groovy.
Groovy allows you the ability to program with Java syntax if you choose, or a dynamic Ruby-like syntax. Additionally, Grails is pretty much a Rails clone for Groovy and will let you write a web app in no time at all.
Whatever you choose to do, good luck and welcome to the wonderful world of Java Web Apps.
As a start, I would recommend you pick up Head First Servlets & JSP. It will give you a nice overview of Java web development. From their you would be better able to pick a web framework to use.
I'd recommend Matt Raible's app fuse .
It will give you a crash course in hooking your app up to a database, using a mvc framework, as well as some of the java build tools.
This App fuse demo will show how quickly he gets things rolling.
For basic simple java based web-app follow below things
Install IDE (eg. eclipse,netbeans)
Install web/application server (eg. Tomcat/Jboss)
Configure server in IDE
Create new dynamic web project with JSP/Servlet
learn/develop and run sample applications which includes advance technology like Spring,Struts,Hibernate,EJB etc.
I believe design is more important than technology, so keep learning design patterns. all major frameworks are based on different design pattern.
I would suggest that you try JSP first. JSP is simpler since you don't have to deal with the underlying server technology, not for simple applications atleast. It will get you up to speed. Later, as you gain experience, you can use servlets directly.
It will also fit well with your PHP intuitions.
It's true that starting with Java Web development is not as easy as PHP, especially with CodeIgniter, a framework that I've fallen in love with.
I'd recommend Grails, but first pick up a book on the subject. I've found that in order to get productive quickly you'll need a proper reference. Personally I used The definitive guide to Grails.
I would recommend grabbing a copy of the Servlet 2.5 Specification for reference purposes. It's a fairly nice read, and not too dry for a specification.
It explains about Sessions, Filters, Listeners, threading model, etc...
Also, take a look at the JSP Model 2 architecture (better link) which explains the best use of servlets and JSPs.
I wouldn't recommend looking at Struts or Spring if you only have a few days to get up to speed from scratch. Once you have gained familiarity with servlets and JSPs, then you could look at Spring MVC for an approach that supports easier unit testing for controllers.
You should better learn basic servlet and JSP lifecycles before you touch any framework.. that ll be better, coz you will have a good grasp of the inner workings.. Head First Servlets and JSP is the book you should go for..
I would consider using Groovy on Grails. It's a lot easier to get started and it has a lot of of things that you need built-in. GWT is available via a plugin as is JQuery.
The nice thing about Groovy is that it is basically a superset of Java with the great quick start speed of Rails.
And it will deploy as a .war to your Java EE app server.
I love the Sam's book, 'Teach yourself J2EE in 21 Days'. Awesome for concept reference and basic syntax. Should be pretty cheap by now too.