- 博客(19)
- 收藏
- 关注
转载 org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception
在测试SpringMVC的下载功能时,出现的错误,原因是mvc的版本太高,应降至5.3.0以下。
2022-08-27 22:40:18 814
转载 Intellij IDEA tomcat控制台显示中文为乱码
如下图所示,Intellij IDEA显示中文为乱码,根据Intellij IDEA控制台输出,Tomcat Log出现乱码,因此可以将问题定位到Tomcat上,具体解决方法:第一步:打开Tomcat安装位置,找到:conf下的logging.properties文件,然后右击使用文本编辑器打开。第二步:把这五个UTF-8都改为:GBK改好后如下图所示。之后重启tomcat后在看控制台输出,中文就没有乱码了,成功解决!...
2022-01-29 16:28:39 240
原创 Java Web获取cookie并解决中文乱码
index.jsp<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%><%@ page import="java.net.URLDecoder" %><%@ page import="java.nio.charset.StandardCharsets" %><html><head> <m
2022-01-29 16:21:33 304
原创 Java Web include指令
<%@ page import="java.util.Date" %><%@ page import="java.text.SimpleDateFormat" %><%-- Created by IntelliJ IDEA. User: Administrator Date: 2022/1/27 Time: 20:39 To change this template use File | Settings | File Templates.--%>.
2022-01-28 17:04:39 853
原创 Java文件的读取写入
public class ReaderAndWriter { public static void main(String[] args) throws IOException { File file = new File("word.txt"); if (!file.exists()) { file.createNewFile(); } FileWriter fw = null; fw = n.
2022-01-21 21:05:39 2007
原创 Java 文本框组件及滚动面板
import javax.swing.*;import java.awt.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;public class JScrollPaneTest extends JFrame{ public JScrollPaneTest(){ Container container = getContentPane(); container.
2022-01-21 18:52:29 651
原创 Java 文件操作
import java.io.File;import java.io.IOException;import java.text.DateFormat;import java.text.SimpleDateFormat;import java.util.Date;public class FileTest { public static void main(String[] args) throws IOException { File file = new File(".
2022-01-21 18:49:29 286
原创 Java JPanel面板
import javax.swing.*;import java.awt.*;public class JPanelTest extends JFrame { public JPanelTest() { Container container = getContentPane(); container.setLayout(new GridLayout(2,2,10,10)); JPanel p1 = new JPanel(new GridLay.
2022-01-21 12:01:45 209
原创 Java对话框窗体和网格布局管理器
import javax.swing.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.sql.*;import java.util.*;import java.awt.*;class MyJDialog extends JDialog{ public MyJDialog(MyFrame frame){ super(frame,"第一个JDialog.
2022-01-19 19:59:19 211
原创 Java对象数组及重写toString
public class Test { public static void main(String[] args) {// Person[] ps = new Person[3]; // 声明一个对象数组,里面有三个对象// System.out.println("---------------数组声明后-------------------");// for (int x = 0; x < ps.length; x++) {// .
2022-01-16 11:48:54 506
原创 Java模拟微信抢红包
import java.util.Scanner;import java.util.Random;public class RedBags{ public static void main(String[] args) { System.out.println("********微信抢红包***********"); Scanner sc = new Scanner(System.in); System.out.println("请输入红包总金.
2022-01-16 10:33:44 937
原创 java接口
interface DrawImage{ public void drawImage();}class Rectangle implements DrawImage{ public void drawImage() { System.out.println("画矩形"); }}class Square implements DrawImage { public void drawImage() { System.out.print.
2022-01-15 20:06:03 82
原创 JAVA类
public class Restuanant { public static Cook cook = new Cook(); public void takeOrder(String dish) { cook.cooking(dish); System.out.println("请慢用"); } public String saySorry() { return "抱歉,无"; } publi.
2022-01-15 16:40:46 115
原创 JDBC对数据库进行简单操作
import javax.swing.*;import java.sql.*;import java.util.*;import java.awt.*;public class Swingtest{ public static void main(String[] args) throws ClassNotFoundException, SQLException { Class.forName("com.mysql.cj.jdbc.Driver"); .
2021-12-18 20:57:00 1048
原创 第二章 基础爬虫案例实战
import requestsimport reimport loggingfrom urllib.parse import urljoinimport jsonfrom os import makedirsfrom os.path import existsimport multiprocessing#logging.basicConfig(level=logging.INFO, #format='%(asctime)s - %(levelnam.
2021-12-11 19:29:06 100
原创 第二章 基础爬虫案例实战
import requestsimport reimport loggingfrom urllib.parse import urljoinimport jsonfrom os import makedirsfrom os.path import existsimport multiprocessing#logging.basicConfig(level=logging.INFO, #format='%(asctime)s - %(levelnam.
2021-12-11 19:27:30 211
原创 机器学习实战——决策树
from numpy import *from math import logimport operatorfrom sklearn.model_selection import train_test_splitfrom sklearn.tree import DecisionTreeClassifierfrom os import listdirimport matplotlib.pyplot as pltfrom sklearn.datasets import load_irisd.
2021-12-07 18:24:51 85
原创 机器学习实战——k近邻分类器的手写识别系统
from numpy import *import operatorfrom sklearn.model_selection import train_test_splitfrom sklearn.neighbors import KNeighborsClassifierfrom os import listdirimport matplotlib.pyplot as pltdef autoNorm(dataSet): minVals = dataSet.min(0) ma.
2021-12-05 15:54:47 1128
原创 机器学习实战——在约会网站上使用k-近邻算法
from numpy import *import operatorfrom sklearn.model_selection import train_test_splitfrom sklearn.neighbors import KNeighborsClassifierfrom os import listdirimport matplotlib.pyplot as pltdef autoNorm(dataSet): minVals = dataSet.min(0) #从一列中.
2021-12-03 19:47:27 77
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人