SSM整合(五):编写前台JSP页面

这里我曾经试过用html,但是好像跳转过去吃不到EL表达式。。。

step5:


这里就是表现层的东西了,我JSP也学得马马虎虎。。

我这里贴一下我的webapp目录

webapp目录


index.jsp

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>首页</title>
</head>
<body>
	<form action="${pageContext.request.contextPath }/login" method="post">
			姓名:<input type="text" name="uesrname" id="uesrname" value=""/>
			密码:<input type="text" name="password" id="password" value=""/>
			<input type="submit" name="submit" value="登录"/>
	</form>
	<br/>
	<form action="${pageContext.request.contextPath }/register" method="post">
			姓名:<input type="text" name="uesrname" id="uesrname" value=""/>
			密码:<input type="text" name="password" id="password" value=""/>
			<input type="submit" name="submit" value="注册"/>
	</form>
	${message }
</body>
</html>

这个文件中,和登录流程相关的就是/login了

welcome.jsp

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>首页</title>
</head>
<body>
	登陆成功<br/>
	${message }${sessionScope.username }
</body>
</html>

这里两个前台文件就写完了

如果我的内容在哪里有问题,欢迎私信指正。

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值