先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7
深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年最新Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Java开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
如果你需要这些资料,可以添加V获取:vip1024b (备注Java)
正文
AppUser user = null;
if(users.size() > 0) {
user = (AppUser) users.get(0);
// Get the user roles
try {
String hql = "FROM AppUserRole R WHERE R.username = :username";
org.hibernate.Query query = session.createQuery(hql)
.setParameter("username", username);
userRoles = new HashSet<AppUserRole>(query.list());
} catch (HibernateException e) {
// You can log the error here. Or print to console
}
user.setUserRole(userRoles);
}
return user;
}
}
*findUserByUsername(String username)* 返回AppUser类型对象。
package com.stiti.service;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import com.stiti.model.AppUser;
import com.stiti.model.AppUserRole;
import com.stiti.dao.LoginDAO;
/**
-
This class gets the appuser information from the database and
-
populates the “org.springframework.security.core.userdetails.User” type object for appuser.
-
@author Stiti Samantray
*/
@Service(“loginService”)
public class LoginServiceImpl implements UserDetailsService {@Autowired
private LoginDAO loginDao;/**
- @see UserDetailsService#loadUserByUsername(String)
*/
@Override
public UserDetails loadUserByUsername( String username ) throws UsernameNotFoundException
{
AppUser user = (AppUser) loginDao.findUserByUsername(username);
List authorities = buildUserAuthority(user.getUserRole());
return buildUserForAuthentication(user, authorities);
}
private List buildUserAuthority(Set appUserRole) {
Set setAuths = new HashSet();
// Build user’s authorities
for (AppUserRole userRole : appUserRole) {
System.out.println(“****” + userRole.getUserRole());
setAuths.add(new SimpleGrantedAuthority(userRole.getUserRole()));
}
List Result = new ArrayList(setAuths);
return Result;
}private User buildUserForAuthentication(AppUser user, List authorities) {
return new User(user.getUsername(), user.getPassword(), true, true, true, true, authorities);
} - @see UserDetailsService#loadUserByUsername(String)
}
##编写Spring MVC应用程序的Controller
现在我们需要编写Spring MVC应用程序的Controller。
我们需要在Controller类中为应用程序的主路径定义一个RequestMapping方法,该路径在我的示例“/”中。当用户打开应用程序URL例如“[http://www.example.com/]( )”时,执行为该请求映射定义的以下方法“loadHomePage()”。在此方法中,它首先获得对此URL的用户身份验证和授权。
Spring-security将首先检查spring配置中的<security:intercept\_url>,以查找允许访问此url路径的角色。在此示例中,它查找允许具有角色“USER”的用户访问此URL路径。如果用户有一个角色= USER,那么它将加载主页。
否则,如果它是匿名用户,则spring安全校验会将它重定向到登录页面。
package com.stiti.controller;
import java.util.HashSet;
import java.util.Set;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.SessionAttributes;
@Controller
@SessionAttributes(value={“accountname”}, types={String.class})
public class HomeController {
@SuppressWarnings("unchecked")
@RequestMapping(value="/", method = RequestMethod.GET)
public String executeSecurityAndLoadHomePage(ModelMap model) {
String name = null;
Set<GrantedAuthority> role = new HashSet<GrantedAuthority>();
//check if user is login
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
最近我根据上述的技术体系图搜集了几十套腾讯、头条、阿里、美团等公司21年的面试题,把技术点整理成了视频(实际上比预期多花了不少精力),包含知识脉络 + 诸多细节,由于篇幅有限,这里以图片的形式给大家展示一部分
-1628077614929)]
最近我根据上述的技术体系图搜集了几十套腾讯、头条、阿里、美团等公司21年的面试题,把技术点整理成了视频(实际上比预期多花了不少精力),包含知识脉络 + 诸多细节,由于篇幅有限,这里以图片的形式给大家展示一部分
[外链图片转存中…(img-OqoST0d4-1628077614932)]
## 总结
至此,文章终于到了尾声。总结一下,我们谈论了简历制作过程中需要注意的以下三个部分,并分别给出了一些建议:
1. 技术能力:先写岗位所需能力,再写加分能力,不要写无关能力;
2. 项目经历:只写明星项目,描述遵循 STAR 法则;
3. 简历印象:简历遵循三大原则:清晰,简短,必要,要有的放矢,不要海投;
> 以及最后为大家准备的福利时间:简历模板+Java面试题+热门技术系列教程视频
![在这里插入图片描述](https://img-blog.csdnimg.cn/img_convert/97ac062d6d86f69baed2b55334ae2030.webp?x-oss-process=image/format,png)
![在这里插入图片描述](https://img-blog.csdnimg.cn/img_convert/31a7da5cad155159e68bdf72ef5dc324.webp?x-oss-process=image/format,png)
![在这里插入图片描述](https://img-blog.csdnimg.cn/img_convert/aebb48117a3f6f3143d315a1a464531f.webp?x-oss-process=image/format,png)
**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**
**需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Java)**
![img](https://img-blog.csdnimg.cn/img_convert/ea05096b5465f6a21a579e432321ef6e.jpeg)
**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**
深入研究,那么很难做到真正的技术提升。**
**需要这份系统化的资料的朋友,可以添加V获取:vip1024b (备注Java)**
[外链图片转存中...(img-CHg3qOrI-1713263749044)]
**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**