当前位置: 首页 > news >正文

网站上的图片一般多大合适这样做网站推广

网站上的图片一般多大合适,这样做网站推广,网上自己建网站,网站建设合同续签申请书文章目录 SSM整合之后xml方式1 系统环境1.1 软件环境1.2 项目环境1.3 配置web.xml1.4 配置jdbc.properties文件1.5 配置SpringMVC核心文件1.6 配置Spring的核心文件1.7 配置MyBatis的核心文件1.8 配置数据库1.9 配置文件位置 2 编写后端代码2.1 编写实体类2.2 编写Dao接口2.3 编… 文章目录 SSM整合之后xml方式1 系统环境1.1 软件环境1.2 项目环境1.3 配置web.xml1.4 配置jdbc.properties文件1.5 配置SpringMVC核心文件1.6 配置Spring的核心文件1.7 配置MyBatis的核心文件1.8 配置数据库1.9 配置文件位置 2 编写后端代码2.1 编写实体类2.2 编写Dao接口2.3 编写Dao映射文件(resource目录下)2.4 编写Service接口2.5 编写ServiceImpl实现类2.6 编写Controller类2.7 代码映射文件位置 3 编写前端代码3.1 编写首页index.jsp3.2 配置Tomcat3.3 webapp下配置图片3.4 编写功能页面WEB-INF下 4 运行访问4.1 请求路径4.2 增删改查界面4.3 项目源代码 SSM整合之后xml方式 1 系统环境 1.1 软件环境 软件版本 IDEA 2021.3 Maven 3.6.3 MySql (Mariadb) 10.10 JDK 1.8 1.2 项目环境 1、创建Maven的web工程 2、引入pom依赖 dependencies!--servlet的依赖--dependencygroupIdjavax.servlet/groupIdartifactIdjavax.servlet-api/artifactIdversion4.0.1/versionscopeprovided/scope/dependency!--jsp的依赖--dependencygroupIdjavax.servlet/groupIdartifactIdjsp-api/artifactIdversion2.0/version/dependency!--JSTL表达式--dependencygroupIdjavax.servlet/groupIdartifactIdjstl/artifactIdversion1.2/version/dependency!--SpringWeb--dependencygroupIdorg.springframework/groupIdartifactIdspring-webmvc/artifactIdversion5.3.1/version/dependency!--spring事务--dependencygroupIdorg.springframework/groupIdartifactIdspring-tx/artifactIdversion5.3.1/version/dependency!--jsckson的依赖--dependencygroupIdcom.fasterxml.jackson.core/groupIdartifactIdjackson-core/artifactIdversion2.14.2/version/dependencydependencygroupIdcom.fasterxml.jackson.core/groupIdartifactIdjackson-databind/artifactIdversion2.14.2/version/dependency!--mybatis的依赖--dependencygroupIdorg.mybatis/groupIdartifactIdmybatis/artifactIdversion3.5.13/version/dependency!--spring整合mybatis--dependencygroupIdorg.mybatis/groupIdartifactIdmybatis-spring/artifactIdversion2.1.1/version/dependency!--mysql依赖--dependencygroupIdmysql/groupIdartifactIdmysql-connector-java/artifactIdversion8.0.28/version/dependency!--Spring的JDBC--dependencygroupIdorg.springframework/groupIdartifactIdspring-jdbc/artifactIdversion5.3.17/version/dependency!--druid连接池--dependencygroupIdcom.alibaba/groupIdartifactIddruid/artifactIdversion1.2.16/version/dependency!--单元测试--dependencygroupIdjunit/groupIdartifactIdjunit/artifactIdversion4.11/versionscopetest/scope/dependency!--lombok插件--dependencygroupIdorg.projectlombok/groupIdartifactIdlombok/artifactIdversion1.18.28/version/dependency/dependencies3 设置插件 buildresourcesresource!--所在的目录--directorysrc/main/java/directory!--包括目录下的.properties .xml文件都会扫描到--includesinclude**/*.properties/includeinclude**/*.xml/include/includesfilteringfalse/filtering/resource/resourcespluginsplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-compiler-plugin/artifactIdversion3.1/versionconfigurationsource1.8/sourcetarget1.8/target/configuration/plugin/plugins/build1.3 配置web.xml 配置前端控制器 !--配置前端控制器--servletservlet-namemyssm/servlet-nameservlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-classinit-paramparam-namecontextConfigLocation/param-nameparam-valueclasspath:config/springmvc.xml/param-value/init-paramload-on-startup1/load-on-startup/servletservlet-mappingservlet-namemyssm/servlet-nameurl-pattern*.do/url-pattern/servlet-mapping注册监听器 !--注册监听器--context-paramparam-namecontextConfigLocation/param-nameparam-valueclasspath:config/applicationContext.xml/param-value/context-paramlistenerlistener-classorg.springframework.web.context.ContextLoaderListener/listener-class/listener注册字符过滤器处理中文乱码 !--注册字符过滤器--filterfilter-namecharacterEncodingFilter/filter-namefilter-classorg.springframework.web.filter.CharacterEncodingFilter/filter-classinit-paramparam-nameencoding/param-nameparam-valueutf-8/param-value/init-paraminit-paramparam-nameforceRequestEncoding/param-nameparam-valuetrue/param-value/init-paraminit-paramparam-nameforceResponseEncoding/param-nameparam-valuetrue/param-value/init-param/filterfilter-mappingfilter-namecharacterEncodingFilter/filter-nameurl-pattern/*/url-pattern/filter-mapping1.4 配置jdbc.properties文件 jdbc.drivercom.mysql.cj.jdbc.Driver jdbc.urljdbc:mysql://localhost:3306/db002 jdbc.usernameroot jdbc.passwordroot1.5 配置SpringMVC核心文件 ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:contexthttp://www.springframework.org/schema/contextxmlns:mvchttp://www.springframework.org/schema/mvcxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd!--springMVC的配置文件 配置controller和其他web相关对象--!--配置扫描--context:component-scan base-packagecom.hx.controller/!--配置视图解析器--bean classorg.springframework.web.servlet.view.InternalResourceViewResolverproperty nameprefix value/WEB-INF/jsp//property namesuffix value.jsp//bean!--配置注解驱动--mvc:annotation-driven/mvc:annotation-driven /beans1.6 配置Spring的核心文件 beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:aophttp://www.springframework.org/schema/aopxmlns:phttp://www.springframework.org/schema/pxmlns:txhttp://www.springframework.org/schema/txxmlns:contexthttp://www.springframework.org/schema/context xsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context.xsdhttp://www.springframework.org/schema/mvchttps://www.springframework.org/schema/mvc/spring-mvc.xsd!--spring的配置文件声明Service dao等工具类对象--!-- 加载配置文件 --context:property-placeholder locationclasspath:config/jdbc.properties /!-- 数据库连接池 --bean iddataSource classcom.alibaba.druid.pool.DruidDataSourcedestroy-methodcloseproperty namedriverClassName value${jdbc.driver} /property nameurl value${jdbc.url} /property nameusername value${jdbc.username} /property namepassword value${jdbc.password} //bean!--声明SqlSessionFactoryBean 创建 sqlSessionFactory--!-- mapper配置mybatis的SqlSessionFactoryBean --!-- 让spring管理sqlsessionfactory 使用mybatis和spring整合包中的 --bean idsqlSessionFactory classorg.mybatis.spring.SqlSessionFactoryBean!-- 数据库连接池 --property namedataSource refdataSource /!-- 加载mybatis的全局配置文件 --property nameconfigLocation valueclasspath:config/mybatis-config.xml //bean!--声明mybatis的扫描创建dao对象--!-- 配置Mapper扫描器 --bean classorg.mybatis.spring.mapper.MapperScannerConfigurerproperty namesqlSessionFactoryBeanName valuesqlSessionFactory/property namebasePackage valuecom.hx.dao//bean!--声明service的扫描--context:component-scan base-packagecom.hx.service//beans1.7 配置MyBatis的核心文件 ?xml version1.0 encodingUTF-8 ? !DOCTYPE configurationPUBLIC -//mybatis.org//DTD Config 3.0//ENhttp://mybatis.org/dtd/mybatis-3-config.dtd configuration!--设置实体类别名--typeAliasespackage namecom.hx.domain//typeAliases!--配置接口文件映射--mappers!--使用package要求1、mapper文件名称和mapper接口名完全一致包括大小写2、mapper文件和mapper接口必须在统一目录--package namecom.hx.dao//mappers /configuration1.8 配置数据库 创建数据库数据表student 表字段如下 1.9 配置文件位置 2 编写后端代码 2.1 编写实体类 Data AllArgsConstructor NoArgsConstructor public class Student {private Integer sid;private String sname;private Integer sage; }2.2 编写Dao接口 Mapper public interface StudentDao {//查询所有ListStudent findAll();//新增数据int addStu(Param(student) Student student);//删除数据int delStuById(Integer sid);//修改数据int updateStu(Student student); }2.3 编写Dao映射文件(resource目录下) ?xml version1.0 encodingUTF-8 ? !DOCTYPE mapper PUBLIC -//mybatis.org//DTD Mapper 3.0//ENhttp://mybatis.org/dtd/mybatis-3-mapper.dtd mapper namespacecom.hx.dao.StudentDao!--查询所有列表--select idfindAll resultTypeStudentselect sid, sname, sagefrom student;/select!--新增数据--insert idaddStuinsert into studentvalues (#{student.sid}, #{student.sname}, #{student.sage});/insert!--删除数据--delete iddelStuByIddeletefrom studentwhere sid #{sid}/delete!--修改数据--update idupdateStu parameterTypeStudentupdate studentset sname#{sname},sage#{sage}where sid #{sid}/update /mapper2.4 编写Service接口 public interface StudentService {//查询所有ListStudent selectAll();//插入数据int insertStu(Student student);int delStuById(Integer sid);int updateStu(Student student); }2.5 编写ServiceImpl实现类 Service public class StudentServiceImpl implements StudentService {Autowiredprivate StudentDao studentDao;Overridepublic ListStudent selectAll() {return studentDao.findAll();}Overridepublic int insertStu(Student student) {return studentDao.addStu(student);}Overridepublic int delStuById(Integer sid) {return studentDao.delStuById(sid);}Overridepublic int updateStu(Student student) {return studentDao.updateStu(student);} }2.6 编写Controller类 1、业务Controller Controller RequestMapping(/student) public class StudentController {Autowiredprivate StudentService studentService;GetMapping(/getAll.do)public ModelAndView getAll() {ListStudent list studentService.selectAll();ModelAndView mv new ModelAndView();mv.addObject(list, list);mv.setViewName(listStu);return mv;}PostMapping(/add.do)public ModelAndView saveStu(Student student) {String tips 插入失败;ModelAndView mv new ModelAndView();int i studentService.insertStu(student);if (i 0) {tips 插入成功;}mv.addObject(data1, tips);mv.setViewName(success);return mv;}RequestMapping(/put.do)public ModelAndView putStu(Student student) {String tips 修改失败;ModelAndView mv new ModelAndView();int i studentService.updateStu(student);if (i 0) {tips 修改成功;}mv.addObject(data2, tips);mv.setViewName(success);return mv;}RequestMapping(value /del.do)public ModelAndView delStu(Integer sid) {String tips 删除失败;ModelAndView mv new ModelAndView();int i studentService.delStuById(sid);if (i 0) {tips 删除成功;}mv.addObject(data3, tips);mv.setViewName(success);return mv;} }2、页面相关Controller RestController RequestMapping(/index) public class IndexController {RequestMapping(/m1Add.do)public ModelAndView m1Add(){ModelAndView mv new ModelAndView();mv.setViewName(add);return mv;}RequestMapping(/m2Put.do)public ModelAndView m2Put(){ModelAndView mv new ModelAndView();mv.setViewName(put);return mv;}RequestMapping(/m3Del.do)public ModelAndView m3Del(){ModelAndView mv new ModelAndView();mv.setViewName(del);return mv;} }2.7 代码映射文件位置 3 编写前端代码 3.1 编写首页index.jsp % page contentTypetext/html;charsetUTF-8 languagejava % html headtitleTitle/titlestylediv {background-color: antiquewhite;width: 400px;height: 200px;margin: 100px auto;text-align: center;background-image: url(images/p5.jpg);background-repeat: no-repeat;}a {text-decoration: none;color: orange;}button {margin: 10px 20px;}/style /head body divh1功能区首页/h1brbuttona href/student/getAll.do查询数据/a/buttonbuttona href/index/m1Add.do插入数据/a/buttonbrbuttona href/index/m2Put.do修改数据/a/buttonbuttona href/index/m3Del.do删除数据/a/button /div /body /html3.2 配置Tomcat 3.3 webapp下配置图片 3.4 编写功能页面WEB-INF下 1 编写 listStu.jsp % page contentTypetext/html;charsetUTF-8 languagejava % % taglib prefixc urihttp://java.sun.com/jsp/jstl/core % %String basePath request.getScheme() :// request.getServerName() : request.getServerPort() request.getContextPath() /; % html headtitle展示所有学生信息/titlestyle.box1 {width: 300px;height: 400px;text-align: center;margin: 10px auto;background-image: url(/images/p3.jpg);background-repeat: no-repeat;}.box2 {width: 80px;height: 25px;text-align: center;margin: 10px auto;}/style /head body div classbox1table border1px width300px height30px aligncenter cellspacing0 cellpadding0caption stylefont-size: 20px学生信息表/captiontr bgcolor#a9a9a9 text-aligncentertd学号/tdtd姓名/tdtd年龄/td/tr%--数据行--%c:forEach items${list} varstu varStatusstrtd${stu.sid}/tdtd${stu.sname}/tdtd${stu.sage}/td/tr/c:forEach/table%--返回到首页--%div classbox2form action%basePath%index.jspinput typesubmit name返回 value返回功能区/form/div /div /body /html2 编写 add.jsp % page contentTypetext/html;charsetUTF-8 languagejava % %String basePath request.getScheme() :// request.getServerName() : request.getServerPort() request.getContextPath() /; % html headtitle新增学生信息/titlestylediv {background-color: antiquewhite;width: 300px;height: 180px;margin: 100px auto;text-align: center;line-height: normal;background-image: url(/images/p1.jpg);background-repeat: no-repeat;}.box2 {width: 80px;height: 25px;text-align: center;margin: auto;}/style /head body divh3新增数据/h3form action/student/add.do methodpost学号input typetext namesid valuebr姓名input typetext namesname valuebr年龄input typetext namesage valuebrinput typesubmit value添加input typereset value重置/form%--返回到首页--%div classbox2form action%basePath%index.jspinput typesubmit name返回 value返回功能区/form/div /div /body /html3 编写 put.jsp % page contentTypetext/html;charsetUTF-8 languagejava % %String basePath request.getScheme() :// request.getServerName() : request.getServerPort() request.getContextPath() /; % html headtitle修改学生信息/titlestylediv {background-color: antiquewhite;width: 300px;height: 180px;margin: 100px auto;text-align: center;line-height: normal;background-image: url(/images/p4.jpg);background-repeat: no-repeat;}.box2 {width: 80px;height: 25px;text-align: center;margin: auto;}/style /head body divh3根据学号修改数据/h3form action/student/put.do methodpost学号input typetext namesid valuebr姓名input typetext namesname valuebr年龄input typetext namesage valuebrinput typesubmit value修改input typereset value重置/form%--返回到首页--%div classbox2form action%basePath%index.jspinput typesubmit name返回 value返回功能区/form/div /div /body /html4 编写 del.jsp % page contentTypetext/html;charsetUTF-8 languagejava % %String basePath request.getScheme() :// request.getServerName() : request.getServerPort() request.getContextPath() /; % html headtitle删除学生信息/titlestylediv {background-color: beige;width: 300px;height: 150px;margin: 100px auto;text-align: center;background-image: url(/images/p2.jpg);background-repeat: no-repeat;}.box2 {width: 80px;height: 25px;text-align: center;margin: auto;}/style /head body divh3根据学号删除数据/h3form action/student/del.do methodgetinput typetext placeholder请输入学号 namesid valueinput typesubmit value删除/form%--返回到首页--%div classbox2form action%basePath%index.jspinput typesubmit name返回 value返回功能区/form/div /div /body /html5 编写success.jsp % page contentTypetext/html;charsetUTF-8 languagejava % % taglib prefixc urihttp://java.sun.com/jsp/jstl/core % %String basePath request.getScheme() :// request.getServerName() : request.getServerPort() request.getContextPath() /; % html headtitleTitle/titlestyle.box1{width: 200px;height: 150px;background-color: lightgoldenrodyellow;margin: 0 auto;text-align: center;}/style /head body div classbox1div classbox2div插入${data1}/divdiv修改${data2}/divdiv删除${data3}/div/div%--返回到首页--%divform action%basePath%index.jspinput typesubmit name返回 value返回功能区/form/div /div /body /html4 运行访问 4.1 请求路径 首页http://localhost:8080 4.2 增删改查界面 查询功能 新增功能 修改功能 删除功能 4.3 项目源代码 https://gitee.com/allureyu/ssm__xml.git 以上纯属个人一手编写欢迎指教不喜勿喷
http://www.w-s-a.com/news/421375/

相关文章:

  • 微交易网站建设wordpress摘要调用
  • 做网站维护需要懂什么网站后台后缀名
  • 网站建设的认可桂平市住房和城乡建设局网站
  • 网站设计师岗位职责域名关键词查询
  • 百度怎样建设网站盐城公司网站建设
  • 站长工具国产2023网站制作 商务
  • 网络新闻专题做的最好的网站杭州网站设计建设公司
  • 电商网站界面设计流程ps培训班一般学费多少钱
  • 西安网站运营上海闵行区网站制作公司
  • 宁波网站推广代运营长链接转化成短链接工具
  • 小企业如何建网站怎么自己制作app
  • 苏州品牌网站制作公司宁波建设工程有限公司
  • 合肥网站建设zgkr互联网创业好项目
  • 哪里学网站建设与管理云落wordpress
  • 网站建设意见做网站涉及到哪些
  • 网站导航栏原型图怎么做怎么样创建一个网站
  • 遨游建站金融网站建站
  • cms企业网站模板上海网站开发平台
  • 贵阳网站建设搜q479185700网站团队建设
  • 电商网站建设 教学总结蚌埠市住房建设部网站
  • 深圳罗湖企业网站发稿类别是什么
  • 做网站基本语言企业应用软件开发
  • 网站建设与运营 市场分析影视小程序搭建
  • vs 团队网站开发中铁建设门户网登录咋进不去了
  • 快速网站建设公司哪家好优秀的网站建设
  • 网站开发的自适应wordpress搜索词结果按文章标题
  • 微网站是用什么开发的wordpress中英文主题
  • 纯静态网站怎么做淄博seo开发
  • 江西新农村建设权威网站盐步网站制作
  • 网站ui设计例子怎么做打鱼网站