• 第3章业务功能开发(用户访问项目)


    3.1首页功能

    用户访问项目首页,首先进入登录页面。

    首先明确需求,规划程序访问流程,画好UML顺序图再编写代码,方便以后对项目进行管理,同时也是开发规范的硬性要求

    我使用的是processOn在线编译网站,当然也可以使用star uml,Rational Rose ,Rational Rose 的下载破解流程连接如下点这里

    项目结构

     

    运行tomcat

    1.IndexController类

    1. package com.it.crm.web.controller;
    2. import org.springframework.stereotype.Controller;
    3. import org.springframework.web.bind.annotation.RequestMapping;
    4. @Controller
    5. public class IndexController {
    6. /*
    7. 理论上,给Controller分配url:http://127.0.0.1:8080/crm/
    8. 为了简便,框架规定省去 协议名://ip:port/项目名称,用/直接代表上面的url,即到达根目录
    9. */
    10. @RequestMapping(value = "/")
    11. public String index(){
    12. return "index";
    13. }
    14. }

    2.进入标记蓝色阴影的index.jsp

    1. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    2. <html>
    3. <head>
    4. <meta charset="UTF-8">
    5. </head>
    6. <body>
    7. <script type="text/javascript">
    8. window.location.href = "settings/qx/user/toLogin.do";
    9. </script>
    10. </body>
    11. </html>

    3.跳转到UserController

    1. package com.it.crm.settings.web.controller;
    2. import org.springframework.stereotype.Controller;
    3. import org.springframework.web.bind.annotation.RequestMapping;
    4. @Controller
    5. public class UserController {
    6. @RequestMapping(value = "/settings/qx/user/toLogin.do")
    7. public String toLogin(){
    8. return "settings/qx/user/login";
    9. }
    10. }

    4.进入登录界面

    1. <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    2. <%
    3. String basePath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/"+request.getContextPath()+"/";
    4. %>
    5. <html>
    6. <head>
    7. <meta charset="UTF-8">
    8. <base href="<%=basePath%>">
    9. <link href="jquery/bootstrap_3.3.0/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
    10. <script type="text/javascript" src="jquery/jquery-1.11.1-min.js"></script>
    11. <script type="text/javascript" src="jquery/bootstrap_3.3.0/js/bootstrap.min.js"></script>
    12. </head>
    13. <body>
    14. <div style="position: absolute; top: 0px; left: 0px; width: 60%;">
    15. <img src="image/IMG_7114.JPG" style="width: 100%; height: 90%; position: relative; top: 50px;">
    16. </div>
    17. <div id="top" style="height: 50px; background-color: #3C3C3C; width: 100%;">
    18. <div style="position: absolute; top: 5px; left: 0px; font-size: 30px; font-weight: 400; color: white; font-family: 'times new roman'">CRM &nbsp;<span style="font-size: 12px;">&copy;2019&nbsp;动力节点</span></div>
    19. </div>
    20. <div style="position: absolute; top: 120px; right: 100px;width:450px;height:400px;border:1px solid #D5D5D5">
    21. <div style="position: absolute; top: 0px; right: 60px;">
    22. <div class="page-header">
    23. <h1>登录</h1>
    24. </div>
    25. <form action="workbench/index.html" class="form-horizontal" role="form">
    26. <div class="form-group form-group-lg">
    27. <div style="width: 350px;">
    28. <input class="form-control" type="text" placeholder="用户名">
    29. </div>
    30. <div style="width: 350px; position: relative;top: 20px;">
    31. <input class="form-control" type="password" placeholder="密码">
    32. </div>
    33. <div class="checkbox" style="position: relative;top: 30px; left: 10px;">
    34. <label>
    35. <input type="checkbox"> 十天内免登录
    36. </label>
    37. &nbsp;&nbsp;
    38. <span id="msg"></span>
    39. </div>
    40. <button type="submit" class="btn btn-primary btn-lg btn-block" style="width: 350px; position: relative;top: 45px;">登录</button>
    41. </div>
    42. </form>
    43. </div>
    44. </div>
    45. </body>
    46. </html>

     

  • 相关阅读:
    软件工程与计算总结(五)软件需求基础
    多路IO转接——前导
    大数据-玩转数据-Python Sftp Mysql 数据
    Hudi Spark源码学习总结-df.write.format(“hudi“).save
    『Java安全』Shiro1.0.0未标准化路径造成越权访问(CVE-2010-3863)复现与浅析
    【操作系统】进程管理(一)—— 进程
    使用Java Spring Boot构建高效的爬虫应用
    【车载开发系列】GIT教程---如何使用GUI来提交变更
    docker-compose 部署方式
    Python之CrawlSpider
  • 原文地址:https://blog.csdn.net/weixin_59334478/article/details/125517920