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

wordpress 100w 数据seo站外推广有哪些

wordpress 100w 数据,seo站外推广有哪些,东莞做一个企业网站,js网站记住密码怎么做1 介绍 一年多前,我就买了好多关于Java开发类的书籍,内容关于Java Web实操、Spring 学习指南、Maven实战、IntelliJ IDEA软件开发与应用等等。可是由于工作繁忙,这些书没系统地看完。这也是参加工作后的无奈吧! 寒假期间的一周&…

1 介绍

一年多前,我就买了好多关于Java开发类的书籍,内容关于Java Web实操、Spring 学习指南、Maven实战、IntelliJ IDEA软件开发与应用等等。可是由于工作繁忙,这些书没系统地看完。这也是参加工作后的无奈吧!

寒假期间的一周(从2024年1月22日–26日),参加了学校组织的一个免费的Java架构师培训。培训的内容包括传统Java Web开发、各种框架的介绍、SSM 项目开发、Spring Boot项目开发、微服务等,很丰富。自己对这些内容很感兴趣,也愿意学,无奈当时工作忙,临近期末批改期末大报告的关键期,没认真听。只好现在重现复盘、学习培训的内容。

2 问题表现及解决方法

其中有一个SSM Java Web项目,我完全按照培训师给出的代码,无法得到正确网页展现。从事后回顾来说,涉及到项目的spring-mvc.xml文件。具体描述如下。

代码文件TeacherController.java用于指定要访问的网址“/teacher/list”,从而能让网页返回一个从MySQL数据库中读取的teacher表信息,其代码如下:

package org.example.controller;import org.example.pojo.Teacher;
import org.example.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;import java.util.List;@RestController
@RequestMapping("/teacher")
public class TeacherController {@Autowiredprivate TeacherService teacherService;/*** 请求地址:/teacher/list* @return 老师列表*/@RequestMapping("/list")public List<Teacher> getTeacherList(){List<Teacher> teacherList = teacherService.getTeacherList();return teacherList;}
}

配置文件spring-mvc.xml的内容如下:

<?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:context="http://www.springframework.org/schema/context"xmlns:mvc="http://www.springframework.org/schema/mvc"xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttps://www.springframework.org/schema/contex/spring-context.xsdhttp://www.springframework.org/schema/mvchttps://www.springframework.org/schema/mvc/spring-mvc.xsdhttp://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx.xsd"><!--组件扫描--><context:component-scan base-package="org.example.*" /><!--注解驱动,能够进行消息转换,返回JSON数据--><mvc:annotation-driven><mvc:message-converters><bean class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter"><property name="defaultCharset" value="utf-8" /><property name="supportedMediaTypes"><list><value>text/html;charset=UTF-8</value><value>application/json</value></list></property></bean></mvc:message-converters></mvc:annotation-driven><!--事文件解析器--><bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"><property name="defaultEncoding" value="UTF-8" /></bean><!--事务管理器--><bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"><property name="dataSource" ref="dataSource" /></bean><!--事务注解驱动器--><tx:annotation-driven/><!--mvc默认处理器 --><mvc:default-servlet-handler />
</beans>

其中,从事后的角度讲,上述配置文件出问题的是如下的xsi:schemaLocation内容:

xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttps://www.springframework.org/schema/contex/spring-context.xsdhttp://www.springframework.org/schema/mvchttps://www.springframework.org/schema/mvc/spring-mvc.xsdhttp://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx.xsd"

2.1 问题表现1及解决

问题表现1

按照上面配置,运行项目(在IDEA中点击启动Tomcat服务器的按钮),能运行,且自动弹出了页面,如下:
在这里插入图片描述
但当我访问 http://localhost:8080/teacher/list 时,出现如下图:
在这里插入图片描述
读取不到MySQL中的teacher表信息。

上面页面提示信息与Tomcat server的执行日志信息是一样的,核心问题为:

14-Mar-2024 11:04:00.528 警告 [RMI TCP Connection(2)-127.0.0.1] org.springframework.util.xml.SimpleSaxErrorHandler.warning Ignored XML validation warning
org.xml.sax.SAXParseException; lineNumber: 16; columnNumber: 60; schema_reference.4: 无法读取方案文档 ‘https://www.springframework.org/schema/contex/spring-context.xsd’, 原因为 1) 无法找到文档; 2) 无法读取文档; 3) 文档的根元素不是 xsd:schema。

14-Mar-2024 11:04:00.537 严重 [RMI TCP Connection(2)-127.0.0.1] org.springframework.web.servlet.FrameworkServlet.initServletBean Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 16 in XML document from file [D:\RBprogramming\StudySSM\ssm_demo\target\web-ssm_demo\WEB-INF\classes\spring-mvc.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 16; columnNumber: 60; cvc-complex-type.2.4.c: 通配符的匹配很全面, 但无法找到元素 ‘context:component-scan’ 的声明。

Caused by: org.xml.sax.SAXParseException; lineNumber: 16; columnNumber: 60; cvc-complex-type.2.4.c: 通配符的匹配很全面, 但无法找到元素 ‘context:component-scan’ 的声明。

问题1解决

更改配置文件spring-mvc.xml中的xsi:schemaLocation的值为:

xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-4.2.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-4.2.xsdhttp://www.springframework.org/schema/mvchttp://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd"

亦即将spring-beans.xsd改为 spring-beans-4.2.xsd,spring-context.xsd改为spring-context-4.2.xsd,spring-mvc.xsd改为spring-mvc-4.2.xsd。

再次运行。可以发现,问题1的表现不再出现。但出现了新的问题。

2.2 问题表现2及解决

问题表现2

运行上面修改后的项目,仍会自动弹出"Hello World!"页面,但访问 http://localhost:8080/teacher/list 时,出现如下图:
在这里插入图片描述
从Tomcat server的执行日志信息中取出核心问题描述:

14-Mar-2024 12:02:58.706 严重 [RMI TCP Connection(2)-127.0.0.1] org.springframework.web.servlet.FrameworkServlet.initServletBean Context initialization failed
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 40 in XML document from file [D:\RBprogramming\StudySSM\ssm_demo\target\web-ssm_demo\WEB-INF\classes\spring-mvc.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 40; columnNumber: 28; cvc-complex-type.2.4.c: 通配符的匹配很全面, 但无法找到元素 ‘tx:annotation-driven’ 的声明。
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:402)

Caused by: org.xml.sax.SAXParseException; lineNumber: 40; columnNumber: 28; cvc-complex-type.2.4.c: 通配符的匹配很全面, 但无法找到元素 ‘tx:annotation-driven’ 的声明。
at com.sun.org.apache.xerces.internal.util.ErrorH

问题2解决

根据问题2的表述及与原始xsi:schemaLocation内容的对比,我认为在xsi:schemaLocation的值中应该追加如下内容:

http://www.springframework.org/schema/tx 
http://www.springframework.org/schema/tx/spring-tx.xsd

最终正确的完整的spring-mvc.xml文件为:

<?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:context="http://www.springframework.org/schema/context"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd"><!--读取数据库配置文件 --><context:property-placeholder location="classpath:jdbc.properties" /><!--数据源 --><bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"><property name="driverClassName" value="${driverClassName}" /><property name="url" value="${url}" /><property name="username" value="${user}"/><property name="password" value="${pwd}" /></bean><!--SqlSession工厂对象 --><bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean" ><property name="dataSource" ref="dataSource" /><property name="mapperLocations" value="classpath:mapper/*.xml" /><property name="plugins" ><array><bean class="com.github.pagehelper.PageInterceptor"></bean></array></property><property name="configuration"><bean class="org.apache.ibatis.session.Configuration" ><property name="mapUnderscoreToCamelCase" value="true" /></bean></property></bean><!--mapper包扫描器 --><bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"><property name="basePackage" value="org.example.mapper" /></bean>
</beans>

运行后,会自动弹出“Hello World!”页面,但是,再次访问http://localhost:8080/teacher/list,服务器的执行log中无限循环报错。

2.3 问题表现3及解决

问题表现3

出现的问题核心描述为:

java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowed

问题3解决

将jdbc的连接设为:

url=jdbc:mysql://localhost:3306/ssm_demo?useSSL=false&allowPublicKeyRetrieval=true

再次运行,访问http://localhost:8080/teacher/list,得到:
在这里插入图片描述
能读取到数据库中的信息了。

3 结语

遇到问题,要敢于解决。培训老师留下了好多空白,需要自己课下摸索。因为培训和平时上课很不一样。培训一般要求是在短时间内讲授大量的内容。

所以参加培训,课下加强编程实践锻炼很有必要。

http://www.yayakq.cn/news/228322/

相关文章:

  • 网页前端开发网站国外网站网站app
  • 建设网站需要做什么ui培训机构排名前十
  • 网站建设需求模板湖南城乡建设部网站
  • 网站建设 猴王网络当前网站开发的现状
  • 空壳网站主体注销上海发布最新情况
  • 旅游网站模板html5网站这么做301
  • 东莞网站建设0086wordpress大全
  • 旅游网站网页设计论文广州市数商云网络科技有限公司
  • 如需锦州网站建设wordpress中国分享插件
  • 网站上线流程分为友情链接价格
  • 淘宝网站怎么做视频教程做美食网站视频
  • 网站开发硬件设计wordpress 域名绑定
  • 网页中网站设计规划流程网站建设比较好公司
  • 中山 网站建设一条龙服务网页特效制作工具
  • 深圳住房和建设厅网站首页网络教学
  • 做门户网站赚广告费网站防恶意注册
  • 织梦网站首页文字修改百度指数查询工具app
  • 要建设一个网站需要什么时候开始有几家做网站的公司
  • 网站注册页面代码中小企业网站建设与推广分析
  • 福州商城网站开发公司wordpress 新窗口
  • 济南卓远网站建设公司中国建设人才网信息网住房和城乡建设岗位培训中心
  • 个人网站建设规划表电商类网站咋做
  • 优化图片传网站怎么修改字体wordpress
  • 凯发网站德国购物网站大全
  • 服务器如何搭建网站长春网站长春网络推广建设
  • 网站常用架构苏州有哪些互联网大厂
  • 企业做网站的费用怎么入账电商排名
  • 榆林做网站公司国家重大建设项目网站地址
  • 柳市做网站非官方网站建设
  • 公司建立自己的网站吗百度平台我的订单