首页 > 代码库 > 小学期总结2
小学期总结2
再接下来几天,我们主要学习了springmvc等内容。
在学习过程中,我们需要定义一个类Userinfo,这是这个项目的基础。
package cn.neusoft.pojo;
public class Userinfo {
private Integer userid;
private String username;
private String pwd;
@Override
public String toString() {
return "Userinfo [userid=" + userid + ", username=" + username
+ ", pwd=" + pwd + "]";
}
public Userinfo() {
super();
}
public Userinfo(String username, String pwd) {
super();
this.username = username;
this.pwd = pwd;
}
public Integer getUserid() {
return userid;
}
public void setUserid(Integer userid) {
this.userid = userid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPwd() {
return pwd;
}
public void setPwd(String pwd) {
this.pwd = pwd;
}
}
在登录网页时,我们需要编写代码。
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="http://www.mamicode.com/">
<title>My JSP ‘index.jsp‘ starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="http://www.mamicode.com/styles.css">
-->
</head>
<body>
This is my JSP page. <br>
</body>
</html>
小学期总结2