<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"/>
<script type='text/javascript' src='<%=path %>/dwr/interface/loginService.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
<script language="javascript">
function check1()
{
if(document.loginForm.userName.value=="")
{
alert("请输入用户名");
document.loginForm.userName.focus();
return false;
}
if(document.loginForm.userPw.value=="")
{
alert("请输入密码");
document.loginForm.userPw.focus();
return false;
}
document.getElementById("indicator").style.display="block";
loginService.login(document.loginForm.userName.value,document.loginForm.userPw.value,0,callback);
}
function callback(data)
{
document.getElementById("indicator").style.display="none";
if(data=="no")
{
alert("用户名或密码错误");
}
if(data=="yes")
{
alert("通过验证,系统登录成功");
window.location.href="<%=path %>/loginSuccess.jsp";
}
}
</script>
<style type="text/css">
* {
margin:0;
padding:0;
}
html {
width:100%;
height:100%;
overflow-x:hidden;
}
body {
height:100%;
margin:0;
padding:0;
font-size:10pt;
background:#F1F1F1;
color:#333;
overflow:auto;
overflow-x:hidden;
}
body#login {
background:#0065AF;
}
body#index {
border-left:200px solid #0065AF;
}
body#page {
padding:20px;
height:auto;
border-top:60px solid #0065AF;
}
a {
color:#0D324F;
}
textarea,select {
background:#F4F4F4;
border:1px solid #A5ACB2;
}
h1 {
position:absolute;
width:1000%;
color:#FFF;
font-size:12pt;
top:0;
left:0;
padding:23px 0 16px 20px;
background:#0065AF;
border-bottom:3px solid #FFF;
}
h2 {
font-size:12px;
padding:8px;
color:#333;
}
p {
margin:10px auto;
}
/**/
#loginForm {
width:400px;
height:250px;
position:absolute;
top:50%;
left:50%;
margin:-150px 0 0 -200px;
background:#FFF;
border:5px solid #999;
}
#loginForm h3 {
background:#000;
color:#FFF;
margin:0 0 30px 0;
padding:14px 0 8px 20px;
}
body {background-image:url(<%=path %>/images/beijing2.png);}
</style>
</head>
<body id="login">
<form action="<%=path %>/admin/index.jsp" id="loginForm" name="loginForm" method="post">
<h3>爱心宠物管理信息系统</h3>
<table align="center" border="0" cellpadding="9" cellspacing="9">
<tr align='center'>
<td style="width: 50px;font-family: 微软雅黑;" align="left">
账号:
</td>
<td align="left">
<input name="userName" type="text" style="width: 200px;height: 20px;"/>
</td>
</tr>
<tr align='center'>
<td style="width: 50px;font-family: 微软雅黑;" align="left">
密码:
</td>
<td align="left">
<input name="userPw" type="password" style="width: 200px;height: 20px;"/>
</td>
</tr>
<tr align='center'>
<td style="width: 50px;" align="left"></td>
<td align="left">
<input type="button" value="登陆" style="width: 80px;font-family: 微软雅黑;" onClick="check1()"/>
<input type="reset" value="重置" style="width: 80px;font-family: 微软雅黑;"/>
<img id="indicator" src="<%=path %>/img/loading.gif" style="display:none"/>
</td>
</tr>
</table>
</form>
</body>
</html>
### 宠物系统后台管理:
### ![](https://s2.51cto.com/images/20210829/1630166683975603.jpg)
### 后台主要功能实现:就是一些前端用户数据的管理:
### ![](https://s2.51cto.com/images/20210829/1630166685435376.jpg)
package com.action;
import java.util.List;
import java.util.Map;
import org.apache.struts2.ServletActionContext;
import com.dao.TAdminDAO;
import com.model.TAdmin;
import com.opensymphony.xwork2.ActionSupport;
public class adminAction extends ActionSupport
{
private int userId;
private String userName;
private String userPw;
private String message;
private String path;
private int index=1;
private TAdminDAO adminDAO;
public String adminAdd()
{
TAdmin admin=new TAdmin();
admin.setUserName(userName);
admin.setUserPw(userPw);
adminDAO.save(admin);
this.setMessage("操作成功");
this.setPath("adminMana.action");
return "succeed";
}
public String adminMana()
{
List adminList=adminDAO.findAll();
Map request=(Map)ServletActionContext.getContext().get("request");
request.put("adminList", adminList);
return ActionSupport.SUCCESS;
}
public String adminDel()
{
adminDAO.delete(adminDAO.findById(userId));
this.setMessage("删除成功");
this.setPath("adminMana.action");
return "succeed";
}
public TAdminDAO getAdminDAO()
{
return adminDAO;
最后总结我的面试经验
2021年的金三银四一眨眼就到了,对于很多人来说是跳槽的好机会,大厂面试远没有我们想的那么困难,摆好心态,做好准备,你也可以的。
另外,面试中遇到不会的问题不妨尝试讲讲自己的思路,因为有些问题不是考察我们的编程能力,而是逻辑思维表达能力;最后平时要进行自我分析与评价,做好职业规划,不断摸索,提高自己的编程能力和抽象思维能力。
资料领取方式:点击这里免费获取
BAT面试经验
实战系列:Spring全家桶+Redis等
其他相关的电子书:源码+调优
面试真题:
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/122971.html