Manual creation (no IDE) java web project, manual ide
Prerequisites
1. Compiler: jdk
2. web server: tomcat
3. Text Editor: sublime, which is used to compile java and jsp files. If not, use notepad.
1. Create a project directory structure, as shown in figure
You can do this in the operating system, such as creating the above structure under the root directory of the d disk.
2. Create a model file in the "src/com/zyz" Directory
Dog. java
package com.zyz;public class Dog { private String name; public String getName(){ return this.name; } public void setName(String name){ this.name=name; } }
3. Compile "Dog. java" and output it to "WEB-INF/classes/com/zyz"
Press "win + R" and enter "cmd" to enter the dos window, and enter
D:
Cd shop
Javac src \ com \ zyz \ Dog. java-d WEB-INF \ classes
4. Create a jsp file under the project root directory, such as "index. jsp"
<%@ page language="java" pageEncoding="utf-8" %><%@ page import="com.zyz.Dog" %><!DOCTYPE html>
After the project is created, the directory structure is as follows:
5. Copy the project root directory "shop" to the tomcat webapps directory.
You can delete the src directory. The released directory is as follows:
6. start tomcat and enter "http: // localhost: 8080/shop/index. jsp" in the browser"