xmlns

springboot2.0国际化

和自甴很熟 提交于 2019-12-05 09:43:42
springboot2.0配合thymeleaf实现页面国际化 1. 引入thymeleaf <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.1.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>cn.jfjb</groupId> <artifactId>crud</artifactId> <version>0.0

第一个 Maven 应用程序

冷暖自知 提交于 2019-12-05 07:46:21
概述 下面我们来学习如何使用 Maven 创建一个 Java Web 应用程序 # 创建 Maven 项目 选择 File -> New -> Project... 选择 Maven 项目 填写项目信息 选择工作空间 # 目录结构 Java Web 的 Maven 基本结构如下: ├─src │ ├─main │ │ ├─java │ │ ├─resources │ │ └─webapp │ │ └─WEB-INF │ └─test │ └─java 结构说明: src :源码目录 src/main/java :Java 源码目录 src/main/resources :资源文件目录 src/main/webapp :Web 相关目录 src/test :单元测试 # IDEA Maven 项目管理 在 IDEA 界面的右侧 Maven Projects 选项,可以管理 Maven 项目的整个生命周期、插件、依赖等 # 完善 Java Web 程序 # POM 修改 pom.xml 配置,内容如下: 1 <?xml version="1.0" encoding="UTF-8"?> 2 <project xmlns="http://maven.apache.org/POM/4.0.0" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema

Spring 初始化bean的方式:InitializingBean、init-method

五迷三道 提交于 2019-12-05 07:30:57
InitializingBean接口为bean提供了初始化方法的方式,它只包括afterPropertiesSet方法,凡是继承该接口的类,在初始化bean的时候会执行该方法。 测试程序如下: import org.springframework.beans.factory.InitializingBean; public class TestInitializingBean implements InitializingBean{ @Override public void afterPropertiesSet() throws Exception { System.out.println("ceshi InitializingBean"); } public void testInit(){ System.out.println("ceshi init-method"); } } 配置文件如下: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www

springmvc-config.xml模板

折月煮酒 提交于 2019-12-05 06:39:53
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring

IDEA下搭建maven管理的DUBBO项目,Zookeeper作为注册中心

荒凉一梦 提交于 2019-12-05 05:02:33
环境:JDK 1.8、 dubbo版本:2.9.2-SNAPSHOT、zookeeper版本: 3.5.1-alpha、IDEA2016 1.下载zookeeper, 点击下载 ,解压即可,重命名conf文件夹中zoo_sample.cfg文件为zoo.cfg并修改为下: # zookeeper中使用的基本时间单位, 毫秒值 tickTime=2000 # follower和leader之间的最长心跳时间 initLimit=10 # 配置leader和follower之间发送消息, 请求和应答的最大时间长度 syncLimit=5 # zk数据存储位置 dataDir=E:\\Work_SoftWare\\zookeeper-3.4.9\\data # zk日志存储位置 dataLogDir=E:\\Work_SoftWare\\zookeeper-3.4.9\\log # 监听client连接的端口号 clientPort=2181 # 清理频率,单位是小时 autopurge.purgeInterval=1 各个配置参数解释见链接 https://my.oschina.net/xiaotian120/blog/194820 启动zookeeper:依次打开bin目录下的zkServer.cmd、zkCli.cmd 如果出现启动闪退的情况,需要用记事本打开以上文件

WPF WPFMediaKit调用USB摄像头拍照

核能气质少年 提交于 2019-12-05 04:37:07
目测网络上有很多类似的方式,多的我就不写了,我就只写怎么实现,总共4步。 第一步:将WPFMediaKit.dll文件添加到项目 第二步:在XAML中引用WPFMediaKit xmlns:WPFMediaKit="clr-namespace:WPFMediaKit.DirectShow.Controls;assembly=WPFMediaKit" 第三步:写界面 <Window x:Class="MoveResizeWinDemo.Window10" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:MoveResizeWinDemo" mc:Ignorable="d" Title="MainWindow" Height="600" Width="800" xmlns

Failed to bind NettyServer on /10.254.4.57:20880, cause: Failed to bind to: /0.0.0.0:20880 配置dubbo遇到的问题

被刻印的时光 ゝ 提交于 2019-12-05 02:13:20
早上重新配置了一下dubbo,报了这个异常 Initialization of bean failed; nested exception is com.alibaba.dubbo.rpc.RpcException: Fail to start server ... Failed to bind NettyServer on /10.254.4.57:20880, cause: Failed to bind to: /0.0.0.0:20880 无法绑定,找半天发现是端口冲突,起了两个提供者,端口占用,后面把测试的关了就行了,或者把配置里面的端口换一下也行。 顺带提一下,dubbo起提供者的时候, 一定要记得配置一个容器! ,这里一般是服务层,配置一个监听器就好了。 如果注册中心是zookeeper,启动完成后看看控制台有没有zookeeper打印的心跳检测机制。 web.xml配置: <?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

过滤器

我是研究僧i 提交于 2019-12-05 01:49:28
过滤器web.xml配置 <?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_3_1.xsd" version="3.1"> <filter> <filter-name>Demo1Filter</filter-name> <filter-class>filter.Demo1Filter</filter-class> <init-param> <param-name>param1</param-name> <param-value>value在这里呢</param-value> </init-param> </filter> <filter-mapping> <filter-name>Demo1Filter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher>

ssm的web.xml配置

馋奶兔 提交于 2019-12-05 00:38:40
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"> <display-name>ssm2</display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <!-- 指定spring的配置文件的路径和名称 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:beans.xml</param-value> </context-param> <listener> <listener-class>org.springframework

springmvc搭建开发

岁酱吖の 提交于 2019-12-04 17:34:22
  springmvc搭建注解开发的小例子   项目搭建展示          导入jar包           1、创建视图和springmvcController.java类 @Controller  //需要进行注解标识 @RequestMapping("/textspringmvc") public class springmvcController { @RequestMapping(value="/getways") public String getWays() { System.out.println("成功进入"); return "show"; } }视图:创建名称为show.jsp。里面随便书写一句文字,用来测试   2、创建配置文件springmvc.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001