发表于: 2017-10-04 22:19:28

1 931



今天完成的事情:

1.写出注册页面

2.了解过滤器


明天计划的事情:

1.写一个过滤器

2.了解监听器

3. 监听在线人数和session的数量。


遇到的问题:

INFO: Error parsing HTTP request header

 Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level.

java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986


原因:

<label for="passwd2" class="input-tips2">确认密码:</label>
<div class="inputOuter2">
   <input type="password" id="passwd2" name="" maxlength="16" class="inputstyle2"/>
</div>

原来为password2


收获:

1.完成注册功能

    @RequestMapping(value = "/a/enrollment",method = RequestMethod.POST)
public void enrollment(HttpServletRequest request, HttpServletResponse response, Model model) throws ServletException, IOException {

String user = request.getParameter("username");
       String pass = request.getParameter("password");
       Integer qq = new Integer(request.getParameter("qq"));
//        loggerController.info("user-jsp: "+user +"\npass-jsp: "+ pass + "\nqq-jsp: "+ qq);
       OutputStream out = response.getOutputStream();
       try {
int userBeing = studyService.selectUserNumber(user);
//            loggerController.info("用户名为: " + user + "   " + userBeing);
           if (userBeing == 0) {
Student study = new Student();
               study.setUser(user);
               Md5Utils md5 = new Md5Utils();
               pass = md5.getMD5(pass);
               study.setPass(pass);
               study.setQq(qq);
//                loggerController.info("注册的用户信息为: " + study);
               int i = studyService.insertSelective(study);
               loggerController.info("返回添加信息: " + i);


2. 整理代码

回顾了几种前后台传输数据的方法


  1. 1
  @RequestMapping(value="/a/student/select/{userId}",method = RequestMethod.GET)
       public String detail(HttpServletRequest request, HttpServletResponse response, Model model, @PathVariable String userId) {
       if(userId!=null) {
传入值:
        /a/student/select/{userId}
url+ /a/student/select/111
  1.  
  2. 2
    @RequestMapping(value = "/a/student/insert",method = RequestMethod.POST)
    public String insert(HttpServletRequest request, HttpServletResponse response, Model model,@RequestBody Student study ) {
        //当没有输入userid时,提示传入参数出错
        if (study.getUserId()!=null) {
传入值:
 {
"user_id" : "JAVA-4433",
"name":"123",
"study_type":1,
"qq": 123456,
"graduated":"郑州大学",
"url":"www.xadsdsa.com",
"wish":"中学生",
"know_from":"知乎"
}
 
  1. 3

    @RequestMapping(value = "/a/student/delete/{userId}",method = RequestMethod.DELETE)
    public String delete(HttpServletRequest request, HttpServletResponse response,Model model,@PathVariable("userId") String userId){

        if (userId!= null) {


4


@RequestMapping(value "/a/login/validate",method = RequestMethod.POST)
public void validate(HttpServletRequest requestHttpServletResponse responseModel model)  throws ServletExceptionIOException
{
   
    String DES_KEY = "12345678";
    String user = request.getParameter("username");
    String pass = request.getParameter("password");
JSP
<div class="uinArea" id="uinArea">
    <label class="input-tips" for="u">帐号:</label>
    <div class="inputOuter" id="uArea">
        <input type="text" id="u" name="username" class="inputstyle"/>
    </div>
</div>
<div class="pwdArea" id="pwdArea">
    <label class="input-tips" for="p">密码:</label>
    <div class="inputOuter" id="pArea">
        <input type="password" id="p" name="password" class="inputstyle"/>
    </div>





进度: 

         任务开始时间:8.14

         预计完成时间:10.6

         是否有延期风险:有,加上过滤器,监听器、事务管理器

禅道:http://task.ptteng.com/zentao/project-task-264.html


PS:要补的东西好多。




返回列表 返回列表
评论

    分享到