The aim of this thread is to gather useful information in regards of Java web development. If you know some tips and tricks, tutorials or any interesting links that has not been already mentioned in previous posts please share with us (please always check to avoid double posting).
Please DO NOT post questions in this thread and also to not post any links leading to websites associated with you as this will goes against forum policies.

Java is installed under /usr/lib/jvm/java-6-sun-1.6.0.15 (version number 1.6.0.15 my change over time)Note please that there been some changes in recent release of Ubuntu 10.04. To install Java you need first make changes in repositories as follows before you can run above installation command

Set environment variable
Many tutorials on the internet will tell you that to set environment variable you need to only type EXPORT command followed by variable name and a path associated with it in your command line/terminal, but they fail to mention that this is only temporary measurement. To make your environment variable permanent in your system you need to edit bashrc file.

sudo gedit ~/.bashrc
//add at the end of the file
export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.15
export PATH=$PATH:$JAVA_HOME/bin

Test

java -version
echo $JAVA_HOME
echo $PATH

Windows XP
Download latest installation package from here at the time of writing this entry it was JDK 6 Update 17. Double click and follow installation instructions (may want to uncheck the option for installing additional tool bars for browsers).
Set environment variables
Start > Control Panel > System or just press Window key(left down between Ctrl and Alt) + Pause/Break(up right at the end of F1-F12 row) and you will get System properties window. Here select Advanced tab followed by Environment Variables button. In system variables you should already have existing entry for PATH so click Edit and append ;C:\Program Files\Java\jdk1.6.0_16\bin pressOK. Now press New and in Variable name type JAVA_HOME and in Variable value type C:\Program Files\Java\jdk1.6.0_16 and press OK.
Test

java -version
echo %JAVA_HOME%
echo %PATH%

BOOKS Head First Servlet & JSP (2nd Edition) is great place to start. It will not show you how to build killer web applications, but it will provide will solid understanding of the basic need to successfully start development of web applications. This book is also recommended reading as part of preparation for Sun Certified Web Component Developer ( SCWCD )
Pro JSP 2 is another great book that will show you some additional Java web technologies like JSTL, JSF and Struts. Plus on top of that you have opportunity to learn something about security, performance, scalability and some recommendations of best practices
For fast learners there is also Beginning JSP, JSF, and Tomcat Web Development: From Novice to Professional
If you have already some knowledge of JSP and servlets you may want to broad your general knowledge of web frameworks have look at Art of Java Web Development: Frameworks and Practices
Starting Struts 2 (if you register with InfoQ)
Online Your First Cup: An Introduction to the Java EE Platform , very fast introduction by Sun (may not be suitable for everyone)
The Java EE 6 Tutorial, Volume I is full web development tutorial provided by Sun that will take you trough various topics (The Web Tier, Web Services, Enterprise Beans, Contexts and Dependency Injection for the Java EE Platform, Persistence, Security and Java EE Supporting Technologies). This very extensive reading.
javapassion.com provides access to numerous free courses related to Java or technologies that can be used alongside of Java
coreservlets.com These training materials are based on Marty's books Core Servlets and JavaServer Pages, More Servlets and JavaServer Pages, and Core Web Programming, and various online tutorials and conference talks.
IBM technical library
Hibernate - Getting Started
HIBERNATE - Relational Persistence for Idiomatic Java
Hibernate Reference Documentation
Apache Struts
Developing a Spring Framework MVC application step-by-step

Comments

SagarSe7en:another helpful tutorial by one of the geniuses of daniweb. Will recommend it to others :-)

harry010:hey. Thanks for all of the links to other resources. very helpful

Installing TomcatWARNING: You need to have JAVA_HOME variable set correctly or Tomcat will complain under any operating system.Ubuntu
Download latest package from http://tomcat.apache.org , at the time of writing this the latest was Tomcat 6.0.20 and I used core binary distribution with "tar.gz" file extension.
Unpack

Windows XP
Download latest package from http://tomcat.apache.org , at the time of writing this the latest was Tomcat 6.0.20 and I used core binary distribution with "zip" file extension.
Unpack, with WinRAR, WinZIP or similar package (Please try to avoid Windows provided extraction software, it does strange thinks to packages). I like to keep it at hand so it can be easily location like this good idea C:\Tomcat6.0.20 .
Running Tomcat
You can start and stop Tomcat by double clicking on startup.bat and shutdown.bat respectively, but that is not wise thing to do. You better to start and stop it by calling these files from Command Prompt

cd C:\Tomcat6.0.20\bin
startup

shutdown

As you see this does require you to go down to actual "bin" folder of Tomcat wherever it is, but by creating new environment variable CATALINA_HOME with assign value of C:\Tomcat6.0.20 you can use following command respectively

Turn on servlet reloading - no need to restart server every time servlet is recompiled that has already been loaded in the server memory. For that you need to edit context.xml in same folder as previously edited tomcat-users.xml

Enable invoker servlet - if you are on the "fast-track" and have no time to edit deployment descriptor (web.xml file in TOMCAT_DIRECTORY/webapps/YOUR_PROJECT/WEB-INF) you need to edit web.xml in same folder as tomcat-users.xml
so new servlet deployed in YOUR_PROJECT/WEB-INF/classes can be called from browser by URL http://localhost:8080/YOUR_PROJECT/servlet/ServletName . You need to remove comments around these sections

mysql -u root -p
//and after that you will be prompted for password
quit;

Windows XP
Download a copy of MySQL Community Server from http://dev.mysql.com/downloads/mysql (I normally use Windows essential option and cannot really say what extras you get with MSI installer).
Install
Welcome to the Setup Wizard for MySQL Server >> Next > Typical >> Next >> Install.
After installation go Next through all the screens of MySQL products presentation till you reach Wizard Complited where it will tell you can configure server in next step. Uncheck registration and leave only Configure Server option checked, press Finish. On new screen press NExt, select Standard Configuration, press Next. On this screen check Install As Windows Service, Include Bin Directory in Windows PATH.
You may want to uncheck Launch the MySQL Server automatically if you will not use database too often. On next screen provide password for "root" user press Next. On last screen you just need to approve action for configuration to take place and all is set.
By default MySQL server will start-up on each computer start-up which may not be desirable so if you wish you can change this behaviour through Administrative Tools (this Windows option is not always available in Start menu so you may want to add like here or just go Start > Run > type control admintools). Once the instruction following after this are executed you will need to start MySQL from Services manually each time you want to use it, so consider how often you will use database and choose appropriate scenario. In Administrative Tools you need to open Services option, find MySQL > right click > Properties > and change Startup type from Automatic to Manual.
Use MySQL
If you ticked checkbox during installation to add MySQL to PATH you can call upon database (as long you have it running) from Command Prompt by executing

mysql -u root -p
//followed by prompt for password

To make it even faster and easier Windows installation comes with MySQL Command Line Client that can be found through Start menu and will automatically execute first command from above and will only ask you for password.

MySQL add-on
If you are not command prompt/line junkie and wish to use some graphical interface you can download MySQL GUI Tools.Ubuntu

Windows XP
Download from http://ant.apache.org/bindownload.cgi . Extract it in convenient location (In my case C:\Ant-1.7.1 ).
Set environment variables
(Check Java Windows XP steps if you do not know where to set environment variables.) Create new variable ANT_HOME with value C:\Ant-1.7.1 and append PATH with ;%ANT_HOME\binMaven
These are steps to set Maven 2

Windows XP
Download from http://maven.apache.org/download.html . Extract it in convenient location (In my case C:\Maven-2.2.1 ).
Set environment variables
(Check Java Windows XP steps if you do not know where to set environment variables.) Create new variable M2_HOME with value C:\Maven-2.2.1 , new variable M2 with value %M2_HOME%\bin , append PATH with ;%M2_HOME%\bin and you can also provide optional memory allocation with new variable MAVEN_OPTS and value of -Xms256m -Xmx512m.m2 directory is used to store your settings.xml containing various info from declarations of library dependencies and custom repositories, plus more. This can be created by executing

mvn clean install

Location under Ubuntu Location under Windows XP C:\Documents and Settings\Peter\.m2SubversionUbuntu

sudo apt-get install subversion

Windows XP
Download one of the Subversion packages here ( I'm using Tigris.org on my Windows machine), run the installation and follow on screen messages.