分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 代码编程

helloweb

发布时间:2023-09-06 02:24责任编辑:董明明关键词:暂无标签

今天演示第一个web小程序

首先列举所需工具

1.tomcat9.0.13服务器软件

2.eclipse软件

首先使用eclipse切换到javaweb工作空间

点击这个按钮在里面找到javaEE就OK了

接下来创建一个动态javaweb项目

写一下如下代码

import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.annotation.WebServlet;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;/** * Servlet implementation class helllo */@WebServlet("/helllo")public class helllo extends HttpServlet {private static final long serialVersionUID = 1L; ??????????/** ????* @see HttpServlet#HttpServlet() ????*/ ???public helllo() { ???????super(); ???????// TODO Auto-generated constructor stub ???}/** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {// TODO Auto-generated method stubresponse.getWriter().append("Hello World!!!").append(request.getContextPath());}/** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {// TODO Auto-generated method stubdoGet(request, response);}}

  然后就ojbk了

helloweb

原文地址:https://www.cnblogs.com/yang295513/p/10029844.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved