首页 技术 正文
技术 2022年11月11日
0 收藏 633 点赞 3,089 浏览 1142 个字

在使用Tomcat部署服务器之前我们需要写一个页面登录的HTML文本

该文本如下

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
body {
background-color: pink
}</style>
</head>
<body>
<h1>欢迎login</h1>
<form action="login_success.html" method="post">
用户名:<input type="text" name="username"><br>
密 码: <input type="password" name=psw><br>
<input type="submit" value="login">
</form></body>
</html>

/login/login.html

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h1>登录成功</h1>
<a href="../index.html" rel="external nofollow" >回首页</a>
</body>
</html>

/login/login_success.html

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<a href="login/login.html" rel="external nofollow" >我要登录</a>
<a href="" rel="external nofollow" >我要注册</a>
</body>
</html>

index.html

2.下载Tomcat并且启动

1.在官网上下载Tomcat

2.进入bin目录

3.运行setup.bat(如果一闪而过,那么就是环境变量中没有java_home和JRE_HOME的路径,配置就可以了)

4.在浏览器上访问localhost:8080 就可以看到Tomcat的网页(该网页是在webapps/ROOT里面的初始网页)

5.如果8080端口号被占用那么就可以去conf里面修改sever.xml文件修改端口号

3.动态web工程

在动态web工程里面写html需要在webcontert里面写,项目默认找的是index.html如果需要修改默认要在Webcontent/web-inf/web.xml里面修改默认配置(用文本打开)服务器里面的web.xml也有一个默认给index.html的设置

4.部署说明

在STS中部署动态的到Tomcat中是将STS工程按照规则拷到文件夹中,JAVA代码在web-inf文件夹下

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,489
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,904
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,737
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,490
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,128
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,291