发表于: 2020-08-11 23:05:03

1 2107


今天完成的事情:

1.完成任务四。

要建立两张表,优秀学生表和职业表

学生表要有,头像,职位,名字,介绍,薪水。

按工资排序查找优秀学生sql语句

<select id="selectAll"  resultMap="BaseResultMap">
 select
<include refid="Base_Column_List" />
 from student order by salary desc limit 0,4
</select>

controller

@Controller
public class TilesController {
@Autowired
   StudentServiece studentServiece;
   @Autowired
   ProfessionService professionService;
   @RequestMapping("/student")
public String student(Map<String,Object> map){
List<Student> studentList=studentServiece.selectAll();
       map.put("stus",studentList);
       return "student";
   }
@RequestMapping("/profession")
public String profession(Map<String,Object> map){
List<Profession> professionList=professionService.selectAll();
       map.put("pro",professionList);
       return "profession";
   }
}

profession.jsp变成动态页面

student.jsp

在服务器上运行项目


自定义tag输出当前时间


在WEB-INF配置tld文件

在jsp页面引入自定义的标签

效果


明天计划的事情:

了解cookie,session,token,拦截器的概念。然后做一个登录注册demo来测试。

遇到的问题:

部署项目到服务器上静态资源全部访问不出来。

原因:在本地跑tomcat的时候是以相对路径来访问静态资源的,而服务器上的tomcat不一样,它是以绝对路径访问静态资源。

解决办法:把静态资源的访问路径改成绝对路径访问

收获:

了解了c:set,c:foreach的使用和自定义标签输出到jsp页面中。


返回列表 返回列表
评论

    分享到