Fundamentals of Web Development and Setting Up a JavaWeb Environment with Tomcat
This article explains the basic concepts of static and dynamic web resources, describes common web servers and development technologies, and provides a step‑by‑step guide to installing, configuring, and troubleshooting Tomcat for JavaWeb applications.
1. Basic concepts : The web refers to resources hosted on Internet servers. Web resources are divided into static (e.g., HTML pages) and dynamic (generated by programs such as JSP/Servlet, ASP, PHP). Static development uses HTML, while dynamic development in Java is often called JavaWeb.
2. Web applications : A web application consists of multiple static and dynamic resources (HTML, CSS, JS, JSP, Java classes, JARs, configuration files) placed in a directory that is mapped as a virtual directory on a web server.
3. History of static and dynamic web : Static pages display the same content to every user; JavaScript can add client‑side effects but cannot change server‑side data or connect to databases. Dynamic pages can change content based on time, user, or database queries.
4. Dynamic web operation : Clients (browsers) send HTTP requests to a web server. A Web Server Plugin determines whether the request is for a static resource (*.htm, *.html) or a dynamic one (*.jsp, *.asp, *.aspx, *.php). Static requests are served directly from the file system, while dynamic requests are passed to a web container that may access a database, assemble the response, and return it to the client.
5. Common dynamic web implementation methods :
Microsoft ASP/ASP.NET – early Windows‑only technology, now largely replaced by ASP.NET using C#.
PHP – fast, powerful, cross‑platform scripting language.
Java Servlet/JSP – platform‑independent, high‑performance, multithreaded solution promoted by Sun (now Oracle).
6. Typical web servers :
WebLogic – Java EE application server from BEA (now Oracle).
WebSphere – IBM Java EE application server.
Tomcat – lightweight Apache implementation of the Java EE servlet/JSP specifications.
IIS – Microsoft Internet Information Services, providing HTTP, FTP, NNTP, and SMTP services.
7. Setting up a JavaWeb development environment with Tomcat :
Download Tomcat from the official site, extract the archive (tar.gz for Linux, exe/zip for Windows), and place the files in a directory. Start the server by executing startup.bat (Windows) or startup.sh (Linux) in the bin folder.
Test the installation by opening a browser and navigating to http://localhost:8080/; the Tomcat welcome page indicates a successful setup.
8. Common Tomcat startup problems :
Missing JAVA_HOME : Tomcat requires the JAVA_HOME environment variable to locate the JDK. Configure it in Windows System → Advanced → Environment Variables, then reference %JAVA_HOME% in the Path variable.
Port 8080 conflict : If another application occupies port 8080, Tomcat cannot start. Check the logs directory for catalina.YYYY-MM-DD.log to see the error, then free the port or change Tomcat’s server.xml configuration.
In summary, when Tomcat fails to start, first verify the JAVA_HOME setting and then ensure the default port is not in use.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java Captain
Focused on Java technologies: SSM, the Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading; occasionally covers DevOps tools like Jenkins, Nexus, Docker, ELK; shares practical tech insights and is dedicated to full‑stack Java development.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
