当前位置:网站首页>CV God of war common code ----- kj15
CV God of war common code ----- kj15
2022-04-21 22:33:00 【just_ learing】
#maven Import pom.xml The necessary configuration <build> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> <include>**/*.tld</include> </includes> <filtering>true</filtering> </resource> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include> <include>**/*.xml</include> <include>**/*.tld</include> </includes> <filtering>true</filtering> </resource> </resources> </build> # Rank as DEBUG Log information output to console and file These two destinations ,console and file Is defined in the following code log4j.rootLogger=DEBUG,console,file # Related settings of console output log4j.appender.console = org.apache.log4j.ConsoleAppender log4j.appender.console.Target = System.out log4j.appender.console.Threshold=DEBUG log4j.appender.console.layout = org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=[%c]-%m%n # File output related settings log4j.appender.file = org.apache.log4j.RollingFileAppender log4j.appender.file.File=./log/kuang.log log4j.appender.file.MaxFileSize=10mb log4j.appender.file.Threshold=DEBUG log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=[%p][%d{yy-MM-dd}][%c]%m%n # Log output level log4j.logger.org.mybatis=DEBUG log4j.logger.java.sql=DEBUG log4j.logger.java.sql.Statement=DEBUG log4j.logger.java.sql.ResultSet=DEBUG log4j.logger.java.sql.PreparedStatement=DEBUG WEB.XML To configure <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0" metadata-complete="true"> <display-name>Welcome to Tomcat</display-name> </web-app> //Jquery Guide pack <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> <script type="text/javascript"> </script> //-------->Ajax servlet layer response.setContentType("text/html;charset=utf-8"); response.setContentType("application/json"); //-------->Ajax Form serialization Submit function add() { var data = {}; // The first way is jq name Selectors //jq Method var formobject= $('form').serializeArray()// Array Serializing arrays $(formobject).each(function(){// Traverse Array Serializing arrays if(data[this.name]){ data[this.name]+=';'+this.value; }else{ data[this.name]=this.value; } }); console.log(data);// verification data data for ( var i in data) { if(data[i].trim()==""){ alert(" Please complete the information "); return; } } if(data.type=="0"){ alert(" Please select the book type "); return; } if(true){ $.ajax( { "url" : "addServlet", // To submit URL route "type" : "post", // How to send the request "data" : data, // Data to be sent to the server "dataType" : "text", // Specifies the data format to transfer "success" : function(result) {// Code to be executed after the request is successful console.log(result); if(result=="true"){ alert(" Add success "); window.location.href="index.jsp"; }else{ } }, "error" : function() { alert(" The Internet is busy "); } } ); }else{ return; } } //--------> Ajax Home page traversal configuration function queryAll() { $.ajax( { "url" : "QuertAllServlet", // To submit URL route "type" : "get", // How to send the request "data" : {}, // Data to be sent to the server "dataType" : "json", // Specifies the data format to transfer "success" : function(result) { // Code to be executed after the request is successful console.log(result); var temp=""; for ( var bm in result) { temp += `<tr> <td>\${result[bm].name}</td> <td>\${result[bm].author}</td> <td>\${result[bm].timeStr}</td> <td>\${result[bm].typeStr}</td>//style Remove underscores <td><a href="javascript:;" style="text-decoration: none" onclick="del(\${result[bm].id})"> Delete </a></td> </tr>` } $("#t1").siblings().remove();// Clear the above query results $("#t1").after(temp);// }, "error" : function() { // Code to execute after the request fails } } ); } //--------> Form centered format <div style="width: 100%; text-align: center"> <h1 style="color: blue"> Student information </h1> <form action="" method="post" enctype="multipart/form-data"> <div><span></span><input type="hidden" name="id" value="${param.id}"/></div> <div><span> Student name </span><input type="text" name="name" /></div> <div><span> Student gender </span><input type="text" name="sex"/></div> <div><span> College age </span><input type="text" name="age"/></div> <div><span> Home address </span><input type="text" name="addresss"/></div> <div><span>Email</span><input type="text" name="Email" /></div> <br><br><br><br> </form> <input type="submit" onclick="add()" value=" Submit " id="submit1" style="font-size: 30px" /> </div> //-------->Ajax in Servlet Start configuration response.setContentType("text/html;charset=utf-8"); request.setCharacterEncoding("utf-8"); response.setCharacteEncoding("utf-8"); response.setContentType("application/json"); //-------->Ajax in Remove other styles document.getElementById('clear').innerHTML = "";// Clear all contents of the page $("#tab").removeAttr("style");// remove Hide styles Display query content $("#s1").after(temp);// increase Display query content //---------> Table style <style> table { border-collapse: collapse; margin: 0 auto; text-align: center; } table td, table th { border: 1px solid #cad9ea; color: #666; height: 30px; } table th { background-color: #CCE8EB; width: 100px; } table tr:nth-child(odd){ background: #fff; } table tr:nth-child(even){ background: #F5FAFA; } </style> //--------->css style <style type="text/css"> html, body { height: 100%; overflow: auto; } body { background: url(ae.jpg) top left; background-size: 100%; } span { color: red; font-size: 30px; } #a { font-size: 20px; } table { /* Set this property , All the rest td All the same width . After doing this ,table The width is fixed , But if the article is long , The text will overwrite */ table-layout: fixed; } td { /* Just auto wrap */ /* word-wrap:break-word; */ width: 10px; height: 11px } </style>
版权声明
本文为[just_ learing]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204212209589622.html
边栏推荐
- 获取用户信息-微信小程序
- http缓存小记
- Get user information - wechat applet
- CC00012. MySQL———————————————
- AutoCAD -- drawing method of three kinds of arrows
- JUNHE shares: the revenue growth in 2021 was steady, and the export performance of benefited products reached a new high
- How can "Xiaodeng" enterprises solve the problem of weak password in AD domain?
- Exercise questions and answers of basic theories and relevant laws and regulations in 2022 supervision engineer examination
- L1-059 ringing stupid bell (20 minutes)
- 2022 intermediate accounting title examination economic law practice questions and answers
猜你喜欢
随机推荐
2022年一级注册建筑师考试建筑材料与构造复习题及答案
Flow chart of event distribution mechanism, the way for programmers to turn over
读书笔记《秋园》《浮木》《我本芬芳》
Lesson 5: correlation coefficient
It is revealed that Xiaomi has new machines this month, and many of its products are ready to go
Software designer - Chapter 6: system security analysis and design
字节日常实习(已OC)
Oracle database 22c insight:_ kgl_ Large_ heap_ assert_ Threshold automatic and manual adjustment
Number to thousand separator number
[untitled]
CPT 102_LEC 11
CC00004. ZABBIX———————————————
YARN线上动态资源调优
[sans titre]
UVM First Steps with UVM - Register Layer
openCV——直方图处理
L1-055 谁是赢家 (10 分)
L1-058 6 turned over (15 points)
Opencv -- histogram processing
CC10000. MySQL———————————————







