how to write hello world servlet Example

前端 未结 6 848
一向
一向 2021-01-13 14:29

javaclass

package com.example;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

// Extend HttpServlet class
public class Helloworld e         


        
6条回答
  •  死守一世寂寞
    2021-01-13 15:32

    Following way will work.

    Create a folder(your poject name,example project) in webapps Inside proect folder create another folder,name it as WEB-INF. Inside WEB-INF past the web.inf file. Create another folder classes inside project folder and keep the .class files. now modify your web.xml as Himanshu Bhardwaj has suggested. restart the server.Then run

提交回复
热议问题