Manual creation (no IDE) java web project, manual ide

Source: Internet
Author: User

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"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.