最后
终极手撕架构师的学习笔记:分布式+微服务+开源框架+性能优化
前台代码:
<% //java
String name=“”;
String psw=“”;
Cookie[] cookies=request.getCookies();
if(cookies!=null&&cookies.length>0){
//遍历Cookie
for(int i=0;i<cookies.length;i++){
Cookie cookie=cookies[i];
//此处类似与Map有name和value两个字段,name相等才赋值,并处理编码问题
if(“name”.equals(cookie.getName())){
name=java.net.URLDecoder.decode(cookie.getValue(),“utf-8”);
}
if(“psw”.equals(cookie.getName())){
psw=cookie.getValue();
}
}
}
%>
//dom
记住密码
//jquery scripts
$(‘#remberBtn’).on(oTools.clickEvent, function(){
var $_this = $(this);
var selected = $_this.data(‘rember’);
if (selected != true) {
$_this.data(‘rember’, true);
$_this.find(‘img’).attr(‘src’, ‘images/checkbox-s-icon.png’);
} else {
$_this.data(‘rember’, false);
$_this.find(‘img’).attr(‘src’, ‘images/checkbox-icon.png’);
}
});
后台代码:
private void addCookie(String username, String password,HttpServletResponse response, HttpServletRequest request) throws UnsupportedEncodingException {
if(!username.equals(“”) && !password.equals(“”)){
//创建Cookie
Cookie nameCookie=new Cookie(“name”,URLEncoder.encode(username,“utf-8”));
Cookie pswCookie=new Cookie(“psw”,password);
//设置Cookie的父路径
nameCookie.setPath(request.getContextPath()+“/”);
pswCookie.setPath(request.getContextPath()+“/”);
难道这样就够了吗?不,远远不够!
提前多熟悉阿里往年的面试题肯定是对面试有很大的帮助的,但是作为技术性职业,手里有实打实的技术才是你面对面试官最有用的利器,这是从内在散发出来的自信。
备战阿里时我花的最多的时间就是在学习技术上,占了我所有学习计划中的百分之70,这是一些我学习期间觉得还是很不错的一些学习笔记
我为什么要写这篇文章呢,其实我觉得学习是不能停下脚步的,在网络上和大家一起分享,一起讨论,不单单可以遇到更多一样的人,还可以扩大自己的眼界,学习到更多的技术,我还会在csdn、博客、掘金等网站上分享技术,这也是一种学习的方法。
今天就分享到这里了,谢谢大家的关注,以后会分享更多的干货给大家!
/bbs.csdn.net/forums/4f45ff00ff254613a03fab5e56a57acb)收录**