1. 程式人生 > >小學期總結2

小學期總結2

void rds erp jsp htm gets tro 接下來 util

再接下來幾天,我們主要學習了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="<%=basePath%>">

<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="styles.css">
-->
</head>

<body>
This is my JSP page. <br>
</body>
</html>

小學期總結2