Idea 在写spring的xml时 出现问题,uri context都是红的

如题,这该怎么解决啊。。。
图片说明

2个回答

问题解决了。。。 重输入UTF-8
reimport maven项目
重写context 让ide自动加载xsd

我是把模块卸载了,又重装上的时候没有导pom文件,最后在右侧栏Maven选项卡里添加上该项目的模块后,就OK了。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Spring基于XML配置时出现报错,但是我的路径应该是对的呀,求大神指导

# 报错信息 ``` 信息: Loading XML bean definitions from class path resource [Appconfig.xml] Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [Appconfig.xml]; nested exception is java.io.FileNotFoundException: class path resource [Appconfig.xml] cannot be opened because it does not exist at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:343) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:223) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:194) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:258) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:128) at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:94) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:133) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:620) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:521) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85) at com.config.RunTest.main(RunTest.java:11) Caused by: java.io.FileNotFoundException: class path resource [Appconfig.xml] cannot be opened because it does not exist at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:180) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:329) ... 13 more ``` # 代码 ``` package com.config; import com.dao.UserDao; import com.service.UserService; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class RunTest { public static void main(String [] args) throws Exception{ ApplicationContext ctx = new ClassPathXmlApplicationContext("Appconfig.xml"); // ApplicationContext ctx=new AnnotationConfigApplicationContext(Appconfig.class); UserService userService=(UserService) ctx.getBean("userService"); userService.login("aaa","bbb"); UserDao userDao=(UserDao) ctx.getBean("userDao"); userDao.login("aaa","bbb"); } } ``` # 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" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <!--通过类的全限定名来声明要创建的bean--> <bean id="userDao" class="com.dao.UserDaoImpl"></bean> <!--通过类的全限定名来声明要创建的bean--> <bean id="userService" class="com.service.UserServiceImpl"> <!--配置依赖注入--> <constructor-arg ref="userDao"></constructor-arg> </bean> </beans> ``` 感谢指导!!!

idea mvc映射不起作用

web mvc项目,xml读取的到控制器,下面是mvc配置 <!-- 启动注解驱动的spring MVC功能,注册请求url和注解POJO类方法的映射--> <mvc:annotation-driven /> <!-- 对模型视图名称的解析,在请求时模型视图名称添加前后缀 --> <context:component-scan base-package="co.controller"/> <mvc:default-servlet-handler /> web.xml配置 <servlet-mapping> <servlet-name>spring</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> 控制器 @Controller @RequestMapping(value = "/") public class mainController { @Autowired private TestService testService; @RequestMapping(value = "login", method = RequestMethod.GET) public String login( ){ System.out.print("login\n"); //view/index.jsp return "login"; } tomcat app context 为默认的 运行结果 警告 [http-nio-8080-exec-1] org.springframework.web.servlet.PageNotFound.noHandlerFound No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'spring' 一直找不到原因,原本的项目在eclipse里可以正常运行

java:我使用了idea的进行web项目部署的时候遇到发布失败

报错: HTTP Status [404] – [Not Found] Type Status Report Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. Apache Tomcat/9.0.0.M21 web.xml代码: ``` <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <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"> <display-name>lanneret</display-name> <!-- 首页 --> <welcome-file-list> <welcome-file>index</welcome-file> </welcome-file-list> <!-- 配置Spring上下文监听器 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!--把applicationContext.xml加入到配置文件中--> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:applicationContext.xml</param-value> </context-param> <!-- Spring MVC 核心控制器 DispatcherServlet 配置 --> <servlet> <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <!--配置dispatcher.xml作为mvc的配置文件--> <param-name>contextConfigLocation</param-name> <param-value>classpath:dispatcher-servlet.xml</param-value> </init-param> <!--<load-on-startup>1</load-on-startup>--> </servlet> <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> </web-app> ``` dispatcher-servlet.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" xsi:schemaLocation="http://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 http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <context:component-scan base-package="com.bean.lanneret.controller"/> <context:annotation-config/> <mvc:annotation-driven/> <!--处理静态资源--> <mvc:resources mapping="/resource/**" location="/resource/"/> <bean id="defaultViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/jsp/page/"/><!--设置JSP文件的目录位置--> <property name="suffix" value=".jsp"/> <property name="exposeContextBeansAsAttributes" value="true"/> </bean> </beans> ``` applicationContext.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 http://www.springframework.org/schema/context/spring-context.xsd"> <context:component-scan base-package="com.bean.lanneret"/> </beans> ```

不用xml文件配置springMVC,为什么不进Controller层

最近在研究spring的思想,看到了一个配置springMVC的方法是不用配置文件自动配置加载的,就想试一下,结果我的代码和源码一模一样,就是不进Controller层,求大牛指点 ``` package spittr.config; import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer; /** * Created by Administrator on 2017/4/18. */ public class SpittrWebAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer { @Override protected Class<?>[] getRootConfigClasses() { return new Class<?>[]{RootConfig.class}; } @Override protected Class<?>[] getServletConfigClasses() { return new Class<?>[]{WebConfig.class}; } /** * 将DispatcherServlet映射到"/" * * @return */ @Override protected String[] getServletMappings() { return new String[]{"/"}; } } ``` 这个相当于web.xml ``` package spittr.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer; import org.springframework.web.servlet.config.annotation.EnableWebMvc; import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; import org.springframework.web.servlet.view.InternalResourceViewResolver; /** * Created by Administrator on 2017/4/18. */ @Configuration @EnableWebMvc @ComponentScan("spittr.web") public class WebConfig extends WebMvcConfigurerAdapter { @Bean public ViewResolver viewResolver() { try { InternalResourceViewResolver resolver = new InternalResourceViewResolver(); resolver.setPrefix("/WEB-INF/views/"); resolver.setSuffix(".jsp"); resolver.setExposeContextBeansAsAttributes(true); return resolver; }catch (Exception e){ e.printStackTrace(); } return null; } @Override public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) { configurer.enable(); } } ``` ``` package spittr.config; /** * Created by Administrator on 2017/4/18. */ import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan.Filter; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.FilterType; import org.springframework.web.servlet.config.annotation.EnableWebMvc; @Configuration @ComponentScan(basePackages = {"spittr"}, excludeFilters = { @Filter(type = FilterType.ANNOTATION, value = EnableWebMvc.class) }) public class RootConfig { } ``` 这是我的Controller文件 ``` package spittr.controller; /** * Created by Administrator on 2017/4/18. */ import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpServletRequest; import static org.springframework.web.bind.annotation.RequestMethod.GET; @Controller("home") public class HomeController { @RequestMapping(value = "/", method = GET) public String home(HttpServletRequest request ) { System.out.println("12312312321"); return "Home"; } } ``` 这是我的jsp文件 ``` <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ page session="false" %> <%-- Created by IntelliJ IDEA. User: Administrator Date: 2017/4/18 Time: 16:20 To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <html> <head> <title>Spittr</title> </head> <body> <h1>Welcome to Spittr1</h1> </body> </html> ``` 这是我的数据结构 ![这是我的数据结构](https://img-ask.csdn.net/upload/201704/19/1492567658_413884.png) 然后后台也没有报任何错误,配置了log4j,级别是debug。 用debug跑项目的时候只是给我提示loaded classer are up to date。Nothing to reload。求大牛指点迷津啊

关于Red5整合自己写好的web项目

写了一个Red5的Demo可以成功运行 现在想整合进我的项目里面 也可以实现在线看视频 但是整合web.xml报错 万千搞不懂为啥 下面贴下web.xml的代码 希望大神指教 自己弄了好久了 报错:java.lang.IllegalStateException: Cannot initialize context because there is already a root application context present - check whether you have multiple ContextLoader* definitions in your web.xml! ``` <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <jsp-config> <taglib> <taglib-uri>http://www.keji09.com/jstl/11erp</taglib-uri> <taglib-location>/WEB-INF/classes/com/keji09/erp/jstl/tag/11erp.tld</taglib-location> </taglib> </jsp-config> <!-- red5 --> <context-param> <param-name>globalScope</param-name> <param-value>default</param-value> </context-param> <context-param> <param-name>parentContextKey</param-name> <param-value>default.context</param-value> </context-param> <context-param> <param-name>webAppRootKey</param-name> <param-value>/micro_film</param-value> </context-param> <!-- red5 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml, WEB-INF/classes/*-web.xml </param-value> </context-param> <!-- red5 --> <listener> <listener-class>org.red5.server.war.WarLoaderServlet</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener> <!-- red5 --> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <filter> <filter-name>SetCharacterEncoding</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>SetCharacterEncoding</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter> <filter-name>HiddenHttpMethodFilter</filter-name> <filter-class> org.springframework.web.filter.HiddenHttpMethodFilter </filter-class> </filter> <filter-mapping> <filter-name>HiddenHttpMethodFilter</filter-name> <servlet-name>SpringDispatcherServlet</servlet-name> </filter-mapping> <servlet> <servlet-name>SpringDispatcherServlet</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext_controller.xml</param-value> </init-param> <load-on-startup>0</load-on-startup> </servlet> <!-- red5 --> <servlet> <servlet-name>gateway</servlet-name> <servlet-class>org.red5.server.net.servlet.AMFGatewayServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>rtmpt</servlet-name> <servlet-class>org.red5.server.net.rtmpt.RTMPTServlet</servlet-class> <load-on-startup>2</load-on-startup> </servlet> <!-- red5 --> <servlet-mapping> <servlet-name>SpringDispatcherServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>*.js</url-pattern> <url-pattern>*.css</url-pattern> <url-pattern>*.gif</url-pattern> <url-pattern>*.jpeg</url-pattern> <url-pattern>*.png</url-pattern> <url-pattern>*.jpg</url-pattern> <url-pattern>*.woff</url-pattern> <url-pattern>*.woff2</url-pattern> <url-pattern>*.tff</url-pattern> <url-pattern>*.ico</url-pattern> <url-pattern>*.doc</url-pattern> <url-pattern>*.docx</url-pattern> <url-pattern>*.xls</url-pattern> <url-pattern>*.xlsx</url-pattern> <url-pattern>*.txt</url-pattern> <url-pattern>*.mp4</url-pattern> <url-pattern>*.ogg</url-pattern> <url-pattern>*.DOCX</url-pattern> <url-pattern>*.XLS</url-pattern> <url-pattern>*.XLSX</url-pattern> <url-pattern>*.TXT</url-pattern> <url-pattern>*.DOC</url-pattern> <url-pattern>*.JS</url-pattern> <url-pattern>*.ICO</url-pattern> <url-pattern>*.CSS</url-pattern> <url-pattern>*.GIF</url-pattern> <url-pattern>*.JPEG</url-pattern> <url-pattern>*.PNG</url-pattern> <url-pattern>*.JPG</url-pattern> <url-pattern>*.WOFF</url-pattern> <url-pattern>*.TFF</url-pattern> <url-pattern>*.html</url-pattern> </servlet-mapping> <!-- red5 --> <servlet-mapping> <servlet-name>gateway</servlet-name> <url-pattern>/gateway</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>rtmpt</servlet-name> <url-pattern>/fcs/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>rtmpt</servlet-name> <url-pattern>/open/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>rtmpt</servlet-name> <url-pattern>/idle/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>rtmpt</servlet-name> <url-pattern>/send/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>rtmpt</servlet-name> <url-pattern>/close/*</url-pattern> </servlet-mapping> <security-constraint> <web-resource-collection> <web-resource-name>Forbidden</web-resource-name> <url-pattern>/WEB-INF/*</url-pattern> </web-resource-collection> <auth-constraint /> </security-constraint> <security-constraint> <web-resource-collection> <web-resource-name>Forbidden</web-resource-name> <url-pattern>/persistence/*</url-pattern> </web-resource-collection> <auth-constraint /> </security-constraint> <security-constraint> <web-resource-collection> <web-resource-name>Forbidden</web-resource-name> <url-pattern>/streams/*</url-pattern> </web-resource-collection> <auth-constraint /> </security-constraint> <!-- red5 --> </web-app> ```

SSH框架项目中文乱码问题,数据插入mysql数据库后,就是??了

**本人刚接触SSH框架项目,一个人自学,会遇到一些个人解决不了的问题,希望寻找志同道合之人一起学习互勉! 如果有师傅带带我必感激不尽! 我对计算机互联网等方面有自己的见解,也十分有热情,喜爱结识志同道合之人,我的QQ:1667134630** 在数据库中手动加两条数据,在浏览器中显示中文是没问题的 ![](https://img-ask.csdn.net/upload/201611/05/1478359436_545746.png) ![图片说明](https://img-ask.csdn.net/upload/201611/05/1478359396_234661.png) 但是点击修改,保存之后就是?了 ![图片说明](https://img-ask.csdn.net/upload/201611/05/1478359659_576831.png) ![图片说明](https://img-ask.csdn.net/upload/201611/05/1478359706_671376.png) 数据库中也变成?了 ![图片说明](https://img-ask.csdn.net/upload/201611/05/1478359759_510580.png) 以下是代码 # list.jsp ``` <%@ page language="java" import="java.util.*" pageEncoding="utf-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> <html> <head> <title>岗位列表</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script language="javascript" src="${pageContext.request.contextPath}/script/jquery.js"></script> <script language="javascript" src="${pageContext.request.contextPath}/script/pageCommon.js" charset="utf-8"></script> <script language="javascript" src="${pageContext.request.contextPath}/script/PageUtils.js" charset="utf-8"></script> <script language="javascript" src="${pageContext.request.contextPath}/script/DataShowManager.js" charset="utf-8"></script> <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/style/blue/pageCommon.css" /> <script type="text/javascript"> </script> </head> <body> <div id="Title_bar"> <div id="Title_bar_Head"> <div id="Title_Head"></div> <div id="Title"><!--页面标题--> <img border="0" width="13" height="13" src="${pageContext.request.contextPath}/style/images/title_arrow.gif"/> 岗位管理 </div> <div id="Title_End"></div> </div> </div> <div id="MainArea"> <table cellspacing="0" cellpadding="0" class="TableStyle"> <!-- 表头--> <thead> <tr align="CENTER" valign="MIDDLE" id="TableTitle"> <td width="200px">岗位名称</td> <td width="300px">岗位说明</td> <td>相关操作</td> </tr> </thead> <!--显示数据列表--> <tbody id="TableData" class="dataContainer" datakey="roleList"> <s:iterator value="list"> <tr class="TableDetail1 template"> <td>${name} </td> <td>${description} </td> <td><s:a onclick="return window.confirm('确定删除当前记录吗?')" action="role_delete?id=%{ id }" namespace="">删除</s:a> <s:a action="role_editUI?id=%{ id }" namespace="">修改</s:a> <s:a href="setPrivilegeUI.html">设置权限</s:a> </td> </tr> </s:iterator> </tbody> </table> <!-- 其他功能超链接 --> <div id="TableTail"> <div id="TableTail_inside"> <a href="saveUI.html"><img src="${pageContext.request.contextPath}/style/images/createNew.png" /></a> </div> </div> </div> </body> </html> ``` # edit.jsp ``` <%@ page language="java" import="java.util.*" pageEncoding="utf-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> <html> <head> <title>岗位设置</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script language="javascript" src="${pageContext.request.contextPath}/script/jquery.js"></script> <script language="javascript" src="${pageContext.request.contextPath}/script/pageCommon.js" charset="utf-8"></script> <script language="javascript" src="${pageContext.request.contextPath}/script/PageUtils.js" charset="utf-8"></script> <script language="javascript" src="${pageContext.request.contextPath}/script/DataShowManager.js" charset="utf-8"></script> <link type="text/css" rel="stylesheet" href="${pageContext.request.contextPath}/style/blue/pageCommon.css" /> <script type="text/javascript"> </script> </head> <body> <!-- 标题显示 --> <div id="Title_bar"> <div id="Title_bar_Head"> <div id="Title_Head"></div> <div id="Title"><!--页面标题--> <img border="0" width="13" height="13" src="${pageContext.request.contextPath}/style/images/title_arrow.gif"/> 岗位设置 </div> <div id="Title_End"></div> </div> </div> <!--显示表单内容--> <div id="MainArea"> <s:form action="role_edit" namespace="/" method="post"> <s:hidden name="id"></s:hidden> <div class="ItemBlock_Title1"><!-- 信息说明<DIV CLASS="ItemBlock_Title1"> <IMG BORDER="0" WIDTH="4" HEIGHT="7" SRC="${pageContext.request.contextPath}/style/blue/images/item_point.gif" /> 岗位信息 </DIV> --> </div> <!-- 表单内容显示 --> <div class="ItemBlockBorder"> <div class="ItemBlock"> <table cellpadding="0" cellspacing="0" class="mainForm"> <tr> <td width="100">岗位名称</td> <td> <s:textfield name="name" cssClass="InputStyle"></s:textfield> * </td> </tr> <tr> <td>岗位说明</td> <td> <s:textarea name="description" cssClass="TextareaStyle"></s:textarea> </td> </tr> </table> </div> </div> <!-- 表单操作 --> <div id="InputDetailBar"> <input type="image" src="${pageContext.request.contextPath}/style/images/save.png"/> <a href="javascript:history.go(-1);"><img src="${pageContext.request.contextPath}/style/images/goBack.png"/></a> </div> </s:form> </div> </body> </html> ``` # web.xml ``` <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <!-- 通过上下文参数指定spring配置文件的位置 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:beans.xml</param-value> </context-param> <!-- 配置spring的上下文载入器监听器 ,项目启动时加载spring --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- 配置struts2的前端控制器 --> <filter> <filter-name>struts</filter-name> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> ```

DispatcherServlet noHandlerFound

web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <!-- <display-name>Erp</display-name> --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:spring/applicationContext-*.xml</param-value> </context-param> <filter> <filter-name>characterEncodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>characterEncodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class> </listener> <servlet> <servlet-name>springmvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:spring/springmvc-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springmvc</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <session-config> <session-timeout>30</session-timeout> </session-config> <welcome-file-list> <welcome-file>index</welcome-file> </welcome-file-list> <error-page> <error-code>403</error-code> <location>/error/403.html</location> </error-page> <error-page> <error-code>404</error-code> <location>/error/404.html</location> </error-page> <error-page> <error-code>500</error-code> <location>/error/500.html</location> </error-page> </web-app> springmvc-servlet.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:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd" default-autowire="byName" default-lazy-init="false"> <!-- 配置静态文件请求,不经过Spring Dispatcher Servlet (PS:该标签是spring 3.0.4新增的,而目前还没有相应的schema,因此编辑器里面会提示mvc:resource标签未定义) --> <mvc:resources location="/js/" mapping="/js/**/*"/> <mvc:resources location="/css/" mapping="/css/**/*"/> <mvc:resources location="/image/" mapping="/image/**/*"/> <mvc:resources location="/error/" mapping="/error/**/*"/> <mvc:resources location="/upload/" mapping="/upload/**/*"/> <mvc:resources location="/widgets/" mapping="/widgets/**/*"/> <mvc:resources location="/robots.txt" mapping="/robots.txt"/> <mvc:resources location="/favicon.ico" mapping="/favicon.ico"/> <!-- 自动搜索指定包目录下的,@Controller,@Component标注的Bean类 context:component-scan 会隐式地注册AutowiredAnnotationBeanPostProcessor、 CommonAnnotationBeanPostProcessor,所以在某种程度上可以把context:annotation-config移除掉 --> <context:component-scan base-package="java" use-default-filters="false"> <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/> </context:component-scan> <bean class="org.springframework.web.servlet.mvc.annotation.annotationMethodHandlerAdapter"> <property name="messageConverters"> <list> <bean class="org.springframework.http.converter.StringHttpMessageConverter"> <property name="supportedMediaTypes"> <list> <value>text/plain;charset=UTF-8</value> </list> </property> </bean> </list> </property> </bean> <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"></bean> <bean id="freemarkerConfiguration" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="location" value="classpath:config/ftl.properties"/> </bean> <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer"> <property name="templateLoaderPath" value="/WEB-INF/ftl/" /> <property name="freemarkerSettings" ref="freemarkerConfiguration"/> </bean> <bean id="viewResolver" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver"> <property name="order" value="1"/> <property name="prefix" value=""/> <property name="suffix" value=".ftl"/> <property name="contentType" value="text/html;charset=utf-8"/> <property name="cache" value="true" /> <property name="exposeSpringMacroHelpers" value="true" /> <property name="requestContextAttribute" value="request" /> <property name="exposeRequestAttributes" value="true" /> <property name="exposeSessionAttributes" value="true" /> <property name="viewClass"> <value>org.springframework.web.servlet.view.freemarker.FreeMarkerView</value> </property> </bean> <bean id="jasperResolver" class="org.springframework.web.servlet.view.jasperreports.JasperReportsViewResolver"> <property name="order" value="2" /> <property name="prefix" value="/WEB-INF/jasper/" /> <property name="suffix" value=".jasper" /> <property name="viewClass" value="org.springframework.web.servlet.view.jasperreports.JasperReportsMultiFormatView" /> <property name="exporterParameters"> <map> <entry key="net.sf.jasperreports.engine.JRExporterParameter.CHARACTER_ENCODING"> <value>utf-8</value> </entry> </map> </property> <property name="headers"> <props> <prop key="Content-Disposition">attachment;</prop> </props> </property> </bean> <bean class="org.springframework.web.servlet.view.XmlViewResolver" p:location="/WEB-INF/jasper/jasper-views.xml" p:order="0" ></bean> </beans> console: 信息: Server startup in 4949 ms 六月 07, 2017 11:43:24 上午 org.springframework.web.servlet.DispatcherServlet noHandlerFound 警告: No mapping found for HTTP request with URI [/Erp/] in DispatcherServlet with name 'springmvc' 六月 07, 2017 11:43:24 上午 org.springframework.web.servlet.DispatcherServlet noHandlerFound 警告: No mapping found for HTTP request with URI [/Erp/error/404.html] in DispatcherServlet with name 'springmvc'![![图片说明](https://img-ask.csdn.net/upload/201706/07/1496807975_868152.png)图片说明](https://img-ask.csdn.net/upload/201706/07/1496807962_123345.png)

请问,如何在tomcat启动时,将自己的自定义信息打印到控制台?

``` 信息: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined 六月 21, 2017 11:12:13 上午 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined 六月 21, 2017 11:12:13 上午 org.apache.catalina.startup.TldConfig execute 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 六月 21, 2017 11:12:13 上午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath ====================================================================== 欢迎使用 JeeSite 快速开发平台 - Powered By http://jeesite.com ====================================================================== 六月 21, 2017 11:12:14 上午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 六月 21, 2017 11:12:27 上午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'springServlet' ========= Enabled refresh mybatis mapper ========= 六月 21, 2017 11:12:38 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory C:\tomcat\apache-tomcat-7.0.75\webapps\docs 六月 21, 2017 11:12:38 上午 org.apache.catalina.startup.TldConfig execute 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for th ```

SpringMVC@RequestMapping返回url问题

遇到一个关于@Request Mapping跳转url的问题,不知怎么解决特来求助 ![图片说明](https://img-ask.csdn.net/upload/201711/26/1511628700_507256.png) ## 控制器: ``` @Controller @RequestMapping("/content") public class ContentHandler { @Autowired private ContentServiceImpl contentService; @RequestMapping(value="/detail/{articleId}") public String detail(@PathVariable("articleId")Integer id,Model model) { /* obtainArticleByArticleId(int):根据文章Id得到的文章信息 */ model.addAttribute("articleDetail", contentService.obtainArticleByArticleId(id)); return "Article/detail"; } @RequestMapping("/show_articles/{userId}") public String myArticles(@PathVariable("userId")Integer getId, Map<String,Object> map) { /* obtainArticlesByAuthorId(int):根据用户Id得到的文章信息 */ map.put("ArticleList", contentService.obtainArticlesByAuthorId(getId)); return "Article/show"; } ... ... } ``` ## 视图: **my_index.jsp** ``` <%@page import="org.springframework.web.context.annotation.SessionScope"%> <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>个人信息</title> </head> <body style="padding: 0px;"> <form> <jsp:include page="/WEB-INF/views/Layout/layoutHeader.jsp"/> <c:set var="userIdFromSession" value="${sessionScope.userId }"/> <a href="create_article">写文章</a> <a href="content/show_articles/${userIdFromSession}">我的文章</a> <a href="my_info">我的信息</a> </form> </body> </html> ``` **show.jsp** ``` <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <form> <jsp:include page="/WEB-INF/views/Layout/layoutHeader.jsp"/> <table style="border: solid gray 1px;text-align:center;"> <tr> <td>标题</td> <td>内容</td> <td></td> </tr> <c:forEach items="${ArticleList}" var="info"> <tr> <td><c:out value="${info.title}" /></td> <td> <c:choose> <!-- 当文章内容的字符串长度大于32时截取文章内容 --> <c:when test="${fn:length(info.content)<32}"> <c:out value="${info.content}" /> </c:when> <c:otherwise> <c:out value="${fn:substring(info.content,0,30)}..."/> </c:otherwise> </c:choose> </td> <td><a href="content/detail/${info.id}" target="_blank">detail</a></td> </tr> </c:forEach> </table> <hr> </form> </body> </html> ```

在JSP中的<c:forEach items="${list}" var="publish" varStatus="status">想更换数据表publish为book,更换后无法显示,请问各位大神怎么解决该问题?

一开始在我的JSP项目中,正常运行显示,后来发现页面显示时,数据库中的数据表显示错误,我在页面当中显示的是数据库library中publish表中的数据信息,但实际上我需要的是数据库library中book表中的信息,替换数据表后,用<c:forEach>标签遍历查询,却显示空白,连表格框架都消失了,请问我该如何修改,才能将表publish成功替换成表book?恳求各位大佬指点,感激不尽! 如下,为publish表成功显示的图片 ![图片说明](https://img-ask.csdn.net/upload/202003/12/1583977874_80197.png) 如下,为book表显示失败的图片 ![图片说明](https://img-ask.csdn.net/upload/202003/12/1583978028_493291.png) ``` <!--以下为publish表显示成功的代码--> <c:forEach items="${list}" var="publish" varStatus="status"> <c:choose> <c:when test="${status.index%2 == '0'}"> <tr class="odd"> <td>${status.index+ 1}</td> <td>${publish.name}</td> <td>${publish.addr}</td> <td>${publish.tel}</td> <td>${book.price}</td> <td> <a href="<%=basePath%>publish/form?id=${book.id}">修改</a> <a href="<%=basePath%>publish/del?id=${book.id}" onclick="return confirm('你确认要删除吗?');"">删除</a> </td> </tr> </c:when> <c:otherwise> <tr class="even"> <td>${status.index+ 1}</td> <td>${publish.name}</td> <td>${publish.addr}</td> <td>${publish.tel}</td> <td>${book.price}</td> <td> <a href="<%=basePath%>publish/form?id=${book.id}">修改</a> <a href="<%=basePath%>publish/del?id=${book.id}" onclick="return confirm('你确认要删除吗?');"">删除</a> </td> </tr> </c:otherwise> </c:choose> </c:forEach> <!--以下为更改后book表显示失败的代码--> <!--以下为更改后book表显示失败的代码--> <!--以下为更改后book表显示失败的代码--> <!--以下为更改后book表显示失败的代码--> <c:forEach items="${list}" var="book" varStatus="status"> <c:choose> <c:when test="${status.index%2 == '0'}"> <tr class="odd"> <td>${status.index+ 1}</td> <td>${book.name}</td> <td>${book.code}</td> <td>${book.auther}</td> <td>${book.price}</td> <td> <a href="<%=basePath%>book/form?id=${book.id}">修改</a> <a href="<%=basePath%>book/del?id=${book.id}" onclick="return confirm('你确认要删除吗?');"">删除</a> </td> </tr> </c:when> <c:otherwise> <tr class="even"> <td>${status.index+ 1}</td> <td>${book.name}</td> <td>${book.code}</td> <td>${book.author}</td> <td>${book.price}</td> <td> <a href="<%=basePath%>book/form?id=${book.id}">修改</a> <a href="<%=basePath%>book/del?id=${book.id}" onclick="return confirm('你确认要删除吗?');"">删除</a> </td> </tr> </c:otherwise> </c:choose> </c:forEach> ``` 当运行publish表那张图显示的项目时,无报错 2020-3-12 10:12:16 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.29 using APR version 1.4.8. 2020-3-12 10:12:16 org.apache.catalina.core.AprLifecycleListener init 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 2020-3-12 10:12:17 org.apache.catalina.core.AprLifecycleListener initializeSSL 信息: OpenSSL successfully initialized (OpenSSL 1.0.1e 11 Feb 2013) 2020-3-12 10:12:17 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-apr-8080"] 2020-3-12 10:12:17 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-apr-8009"] 2020-3-12 10:12:17 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 849 ms 2020-3-12 10:12:17 org.apache.catalina.core.StandardService startInternal 信息: Starting service Catalina 2020-3-12 10:12:17 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/7.0.52 2020-3-12 10:12:17 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\Code 2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined 2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/core is already defined 2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined 2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined 2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined 2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined 2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined 2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined 2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined 2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined 2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined 2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined 2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined 2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined 2020-3-12 10:12:28 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined 2020-3-12 10:12:28 org.apache.tomcat.websocket.server.WsSci onStartup 信息: JSR 356 WebSocket (Java WebSocket 1.0) support is not available when running on Java 6. To suppress this message, run Tomcat on Java 7, remove the WebSocket JARs from $CATALINA_HOME/lib or add the WebSocketJARs to the tomcat.util.scan.DefaultJarScanner.jarsToSkip property in $CATALINA_BASE/conf/catalina.properties. Note that the deprecated Tomcat 7 WebSocket API will be available. 2020-3-12 10:12:28 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 2020-3-12 10:12:29 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 2020-3-12 10:12:41 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'springServlet' ========= Enabled refresh mybatis mapper ========= 2020-3-12 10:13:00 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\docs 2020-3-12 10:13:00 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\examples 2020-3-12 10:13:00 org.apache.catalina.core.ApplicationContext log 信息: ContextListener: contextInitialized() 2020-3-12 10:13:00 org.apache.catalina.core.ApplicationContext log 信息: SessionListener: contextInitialized() 2020-3-12 10:13:00 org.apache.catalina.core.ApplicationContext log 信息: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@fa4b23') 2020-3-12 10:13:00 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\host-manager 2020-3-12 10:13:00 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\igeek 2020-3-12 10:13:00 org.apache.catalina.loader.WebappClassLoader validateJarFile 信息: validateJarFile(D:\MyEclipse\Tomcat7.0\webapps\igeek\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class 2020-3-12 10:13:01 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\library 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://www.springframework.org/tags/form is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://www.springframework.org/tags is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/core is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined 2020-3-12 10:13:04 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined 2020-3-12 10:13:04 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 2020-3-12 10:13:04 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 2020-3-12 10:13:14 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\manager 2020-3-12 10:13:14 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\ROOT 2020-3-12 10:13:14 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\springmvc03fAjax 2020-3-12 10:13:14 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\springmvc03LYF 2020-3-12 10:13:16 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://www.springframework.org/tags/form is already defined 2020-3-12 10:13:16 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://www.springframework.org/tags is already defined 2020-3-12 10:13:16 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 2020-3-12 10:13:16 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\MyEclipse\Tomcat7.0\webapps\SSH 2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/core_rt is already defined 2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/core is already defined 2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined 2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/fmt_rt is already defined 2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined 2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined 2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/functions is already defined 2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/permittedTaglibs is already defined 2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://jakarta.apache.org/taglibs/standard/scriptfree is already defined 2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/sql_rt is already defined 2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined 2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/sql is already defined 2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/xml_rt is already defined 2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined 2020-3-12 10:13:27 org.apache.catalina.startup.TaglibUriRule body 信息: TLD skipped. URI: http://java.sun.com/jsp/jstl/xml is already defined 2020-3-12 10:13:27 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath ====================================================================== 欢迎使用 JeeSite 快速开发平台 - Powered By http://jeesite.com ====================================================================== 2020-3-12 10:13:28 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 2020-03-12 10:13:32,591 WARN [net.sf.ehcache.DiskStorePathManager] - diskStorePath '..\temp\jeesite\ehcache' is already used by an existing CacheManager either in the same VM or in a different process. The diskStore path for this CacheManager will be set to ..\temp\jeesite\ehcache\ehcache_auto_created4673197487363253977diskstore. To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache.xml) for each CacheManager instance. 2020-03-12 10:13:32,657 WARN [sf.ehcache.store.disk.DiskStorageFactory] - Data in persistent disk stores is ignored for stores from automatically created directories. Remove diskPersistent or resolve the conflicting disk paths in cache configuration. Deleting data file D:\MyEclipse\Tomcat7.0\bin\..\temp\jeesite\ehcache\ehcache_auto_created4673197487363253977diskstore\active%0053essions%0043ache.data 2020-3-12 10:13:41 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'springServlet' ========= Enabled refresh mybatis mapper ========= 2020-3-12 10:13:50 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-apr-8080"] 2020-3-12 10:13:50 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-apr-8009"] 2020-3-12 10:13:50 org.apache.catalina.startup.Catalina start 信息: Server startup in 92843 ms 当运行book表那张图显示的项目时,出现报错 报错信息: 2020-3-12 10:14:33 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'springmvc' 2020-3-12 10:14:36 org.apache.jasper.compiler.TldLocationsCache tldScanJar 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. 2020-3-12 10:14:38 org.apache.catalina.core.ApplicationDispatcher invoke 严重: Servlet.service() for servlet jsp threw exception javax.el.PropertyNotFoundException: Property 'code' not found on type com.library.entity.Publish at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:229) at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:206) at javax.el.BeanELResolver.property(BeanELResolver.java:317) at javax.el.BeanELResolver.getValue(BeanELResolver.java:85) at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:104) at org.apache.el.parser.AstValue.getValue(AstValue.java:182) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184) at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:967) at org.apache.jsp.WEB_002dINF.jsp.publishList_jsp._jspService(publishList_jsp.java:708) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338) at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) at javax.servlet.http.HttpServlet.service(HttpServlet.java:620) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:119) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2441) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2430) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) 2020-3-12 10:14:38 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [springmvc] in context with path [/library] threw exception [An exception occurred processing JSP page /WEB-INF/jsp/publishList.jsp at line 123 120: <tr class="odd"> 121: <td>${status.index+ 1}</td> 122: <td>${book.name}</td> 123: <td>${book.code}</td> 124: <td>${book.auther}</td> 125: <td>${book.price}</td> 126: <td> Stacktrace:] with root cause javax.el.PropertyNotFoundException: Property 'code' not found on type com.library.entity.Publish at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:229) at javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:206) at javax.el.BeanELResolver.property(BeanELResolver.java:317) at javax.el.BeanELResolver.getValue(BeanELResolver.java:85) at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:104) at org.apache.el.parser.AstValue.getValue(AstValue.java:182) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184) at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:967) at org.apache.jsp.WEB_002dINF.jsp.publishList_jsp._jspService(publishList_jsp.java:708) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338) at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:238) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) at javax.servlet.http.HttpServlet.service(HttpServlet.java:620) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:119) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2441) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2430) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)

ssm 框架中能够访问到controller层,return页面时报404

## controller层 package com.qhmu.ssm.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class mainController { @RequestMapping("/inde") public String index(){ for(int i=0;i<10;i++){ System.out.println(i); } return "in"; } @RequestMapping("/abc.do") public String list(){ return "list"; } } ## web.xml配置 <!--1、 启动 spring 的容器 --> <!-- needed for ContextLoaderListener --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </context-param> <!-- Bootstraps the root web application context before servlet initialization --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- 2、前端控制器 --> <servlet> <servlet-name>dispatcherServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dispatcherServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <!-- 3、字符编码过滤器 ,一定要放在所有编码之前的--> <filter> <filter-name>CharacterEncodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>utf-8</param-value> </init-param> <init-param> <param-name>forceRequestEncoding</param-name> <param-value>true</param-value> </init-param> <init-param> <param-name>forceResponseEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter-mapping> <filter-name>CharacterEncodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- rest风格的URI ,将普通的post请求转为delete或者put请求--> <filter> <filter-name>HiddenHttpMethodFilter</filter-name> <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class> </filter> <filter-mapping> <filter-name>HiddenHttpMethodFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app> ## springmvc配置 <!-- 1、springmvc配置文件,包含网站跳转逻辑控制,配置 --> <context:component-scan base-package="com.qhmu.ssm.controller" ><!--use-default-filters="false" --> <!-- 只扫描控制器 --> <!-- <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/> --> </context:component-scan> <!--2、配置视图解析器,方便页面返回 --> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/views/"></property> <property name="suffix" value=".jsp"></property> </bean> <!-- 两个标准配置 --> <!-- 将 springmvc不能处理的资源交给Tomcat--> <mvc:default-servlet-handler/> <!-- 能支持springmvc一些更高级的功能,比如:JSR303校验,快捷的ajax请求...映射动态请求 --> <mvc:annotation-driven /> <!-- <mvc:resources mapping="/resources/**" location="/resources/" /> --> </beans> ## spring配置 <!-- 扫描所有除了控制器的包 --> <context:component-scan base-package="com.qhmu"> <!-- <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/> --> </context:component-scan> <!-- spring配置文件,这里主要配置和业务逻辑相有关的 --> <!-- =======================数据源,事务控制等====================== --> <context:property-placeholder location="classpath:dbconfig.properties"/> <bean id="pooledDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="jdbcUrl" value="${jdbc.jdbcUrl}"></property> <property name="driverClass" value="${jdbc.driverClass}"></property> <property name="user" value="${jdbc.user}"></property> <property name="password" value="${jdbc.password}"></property> </bean> <!--==================== 配置和mybatis的整合 ==================--> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <!-- mybaties全局配置 --> <property name="configLocation" value="classpath:mybaties-config.xml"></property> <property name="dataSource" ref="pooledDataSource"></property> <!--指定mybatis的mapper文件位置 --> <property name="mapperLocations" value="classpath:mapper/*.xml"></property> </bean> <!-- 配置扫描器,将mybaties的mapper接口的实现类加入IOC容器中 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <!-- 扫描所有的dao接口的实现,加入IOC容器中 --> <property name="basePackage" value="com.qhmu.ssm.dao"></property> </bean> <!-- 配置一个可以执行批量操作的SQLSession --> <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate"> <constructor-arg name="sqlSessionFactory" ref="sqlSessionFactory"></constructor-arg> <constructor-arg name="executorType" value="BATCH"></constructor-arg> </bean> <!--==================== 事务控制的配置 ===================--> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <!-- 管理事务就先控制住数据源 --> <property name="dataSource" ref="pooledDataSource"></property> </bean> <!-- 开启基于注解的事务,使用xml配置形式的事务(必要主要的都是使用配置式) --> <aop:config> <!-- 切入点表达式 --> <aop:pointcut expression="execution(* com.qhmu.ssm.service..*(..))" id="txPoint"/> <!-- 配置事务曾强 --> <aop:advisor advice-ref="txAdvice" pointcut-ref="txPoint"/> </aop:config> <!-- 配置事务曾强 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <!-- 所有方法都是事务方法 --> <tx:method name="*"/> <!--以get开始的方法 --> <tx:method name="get*" read-only="true"/> </tx:attributes> </tx:advice> <!-- =============================================== --> <!--spring配置文件核心:(数据源,与mybatis整合,事务控制) --> </beans> ## 包结构 ![图片说明](https://img-ask.csdn.net/upload/201806/22/1529609202_458251.png)

Did not find handler method for [/index.jsp]。。。。

新手,我只是页面访问http://localhost:8080/ce2/eq/userAction/loginInit.do 能到action就是 renturn “index”提示找不到 页面404 preHandle方法名:loginInit 11:15:52.754 [http-bio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Rendering view [org.springframework.web.servlet.view.InternalResourceView: name 'index'; URL [/eq/index.jsp]] in DispatcherServlet with name 'ce' 11:15:52.755 [http-bio-8080-exec-3] DEBUG o.s.w.s.view.InternalResourceView - Added model object 'locale' of type [java.lang.String] to request in view with name 'index' 11:15:52.756 [http-bio-8080-exec-3] DEBUG o.s.w.s.view.InternalResourceView - Forwarding to resource [/eq/index.jsp] in InternalResourceView 'index' 11:15:52.762 [http-bio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - DispatcherServlet with name 'ce' processing GET request for [/ce2/eq/index.jsp] 11:15:52.762 [http-bio-8080-exec-3] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /index.jsp 11:15:52.762 [http-bio-8080-exec-3] DEBUG o.s.w.s.m.m.a.RequestMappingHandlerMapping - Did not find handler method for [/index.jsp] 11:15:52.762 [http-bio-8080-exec-3] WARN o.s.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/ce2/eq/index.jsp] in DispatcherServlet with name 'ce' 11:15:52.762 [http-bio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Successfully completed request afterCompletion方法名:loginInit 11:15:52.763 [http-bio-8080-exec-3] DEBUG o.s.web.servlet.DispatcherServlet - Successfully completed request 11:15:52.763 [http-bio-8080-exec-3] DEBUG o.s.o.h.s.OpenSessionInViewFilter - Closing single Hibernate Session in OpenSessionInViewFilter 11:15:52.763 [http-bio-8080-exec-3] DEBUG o.s.o.hibernate3.SessionFactoryUtils - Closing Hibernate Session **web.xml** <?xml version="1.0" encoding="UTF-8"?> <web-app id="ce" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:conf/spring.xml </param-value> </context-param> <!--<context-param> <param-name>webAppRootKey</param-name> <param-value>ce2</param-value> </context-param>--> <filter> <filter-name>encoding</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> <init-param> <param-name>forceEncoding</param-name> <param-value>true</param-value> </init-param> </filter> <filter> <filter-name>osivFilter</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> </filter> <filter-mapping> <filter-name>encoding</filter-name> <url-pattern>*.do</url-pattern> </filter-mapping> <filter-mapping> <filter-name>osivFilter</filter-name> <url-pattern>*.do</url-pattern> </filter-mapping> <filter-mapping> <filter-name>encoding</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <filter-mapping> <filter-name>osivFilter</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <filter-mapping> <filter-name>encoding</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class> </listener> <servlet> <servlet-name>ce</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:conf/spring/ce-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>ce</servlet-name> <url-pattern>/eq/*</url-pattern> </servlet-mapping> <session-config> <session-timeout>30</session-timeout> </session-config> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> **spring.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:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd" default-lazy-init="true"> <context:property-placeholder location='WEB-INF/setup.properties' /> <bean id="dataSourceDruid" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"> <property name="url" value="${jdbc.jdbcUrl}" /> <property name="username" value="${jdbc.user}" /> <property name="password" value="${jdbc.password}" /> <property name="initialSize" value="20" /> <property name="minIdle" value="10" /> <property name="maxActive" value="500" /> <property name="maxWait" value="3000" /> <property name="timeBetweenEvictionRunsMillis" value="60000" /> <property name="minEvictableIdleTimeMillis" value="300000" /> <property name="validationQuery" value="SELECT getdate()" /> <property name="testWhileIdle" value="true" /> <property name="testOnBorrow" value="false" /> <property name="testOnReturn" value="false" /> <property name="poolPreparedStatements" value="true" /> <property name="maxPoolPreparedStatementPerConnectionSize" value="20" /> <property name="filters" value="stat" /> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSourceDruid"/> </property> <property name="mappingLocations"> <list> <value>classpath*:conf/hbm/*.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="connection.autoReconnect">true</prop> <prop key="connection.autoReconnectForPools">true</prop> <prop key="connection.is-connection-validation-required">true</prop> <prop key="hibernate.dialect"> com.ce.util.SqlServer2008Dialect </prop> <prop key="hibernate.show_sql" >false</prop> <prop key="hibernate.format_sql">false</prop> <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop> <prop key="hibernate.cache.use_second_level_cache">false</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.jdbc.batch_size">20</prop> </props> </property> </bean> <bean id="cacheRegionFactory" class="com.ce.hibernate.EhcacheRegionFactory"> <property name="configLocation"> <value>classpath:conf/spring/ehcache-application.xml</value> </property> <property name="diskStoreLocation"> <value>/WEB-INF/cache/application</value> </property> </bean> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref = "sessionFactory"/> </bean> <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/> <import resource="classpath:conf/spring/spring-sys-conf.xml" /> </beans> **UserAction** package com.ce.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.ce.biz.UserBiz; import com.ce.entity.User; import com.ce.web.ParentsControl; /** * 用户action */ @Controller public class UserAction extends ParentsControl{ private static final Logger log = LoggerFactory.getLogger(UserAction.class); private User user; @Autowired private UserBiz userBiz; @RequestMapping(value={"userAction/loginInit.do"},method={ RequestMethod.GET}) public String loginInit(HttpServletRequest request, HttpServletResponse response){ // String root=request.getSession().getServletContext().getRealPath("/"); // request.setAttribute("ctx", root); return "index"; } }![图片说明](https://img-ask.csdn.net/upload/201607/06/1467775355_151478.png)

springmvc写的注册登陆系统,注册可以,登陆的时候报NO DataSource specified

新手,刚学习springmvc,尝试写一个简单的注册登陆系统,发现登陆一直报错,麻烦各位大佬帮一下忙看一下,感激不尽。 JDBCOperater.java ``` package main.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.RowCallbackHandler; import org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport; import java.sql.ResultSet; import java.sql.SQLException; import java.util.HashMap; import java.util.Map; public class JDBCOperater extends NamedParameterJdbcDaoSupport { @Autowired JdbcTemplate jdbcTemplate=new JdbcTemplate(); public void insertNamedParameter(User user){ String sql="INSERT INTO user_t(name,password)" +"VALUES(:name,:password)"; Map<String,Object> parameters=new HashMap<String,Object>(); parameters.put("name",user.getName()); parameters.put("password",user.getPassword()); getNamedParameterJdbcTemplate().update(sql,parameters); } public int getMatchCode(String Name,String Password){ String sql="SELECT count(*) from user_t where name=? and password=?"; return jdbcTemplate.queryForObject(sql,new Object[]{Name,Password},Integer.class); } public User findUserByUserName(final String Name){ String sql="SELECT name,password from user_t where name=?"; final User user=new User(); jdbcTemplate.query(sql, new Object[]{Name}, new RowCallbackHandler() { @Override public void processRow(ResultSet resultSet) throws SQLException { user.setName(Name); user.setPassword(resultSet.getString("name")); } }); return user; } public boolean hasMatchUser(String Name,String Password){ int matchCount=getMatchCode(Name,Password); System.out.println(matchCount); if (matchCount>0){ return true; }else { return false; } } } ``` User.java ``` package main.User; public class User { private String name; private String password; private Integer id; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } } ``` UserController.java ``` package main.User; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.http.HttpRequest; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; import javax.security.auth.login.LoginContext; import javax.servlet.http.HttpServletRequest; @Controller public class UserController { @RequestMapping(value = "/user",method = RequestMethod.GET) public ModelAndView user(){ User user=new User(); return new ModelAndView("user","command",user); } JdbcTemplate jdbcTemplate=new JdbcTemplate(); @RequestMapping(value = "/login",method = RequestMethod.GET) public ModelAndView login(){ User user1=new User(); return new ModelAndView("login","command",user1); } @RequestMapping(value = "/addUser",method = RequestMethod.POST) public String addUser(@ModelAttribute("SpringWeb")User user,Model model){ model.addAttribute("name",user.getName()); model.addAttribute("password",user.getPassword()); ApplicationContext context=new ClassPathXmlApplicationContext("Spring-Database.xml"); JDBCOperater jdbcOp=(JDBCOperater) context.getBean("user"); jdbcOp.insertNamedParameter(user); //((ConfigurableApplicationContext)context).close(); return "result"; } @RequestMapping(value = "/login",method = RequestMethod.POST) public String login(@ModelAttribute("SpringWeb")User user, Model model, JdbcTemplate jdbcTemplate){ model.addAttribute("name",user.getName()); model.addAttribute("password",user.getPassword()); ApplicationContext context1=new ClassPathXmlApplicationContext("Spring-Database.xml"); JDBCOperater jdbcOperater=new JDBCOperater(); jdbcOperater.getMatchCode(user.getName(),user.getPassword()); JDBCOperater jdbcOp=(JDBCOperater) context1.getBean("login"); Boolean isValidUser=jdbcOperater.hasMatchUser(user.getName(),user.getPassword()); // System.out.println(isValidUser); if (!isValidUser){ return "error"; }else { return "success"; } } } ``` Spring-DataBase.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:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.cj.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost:3306/spring"/> <property name="username" value="root"/> <property name="password" value="123456"/> </bean> <bean id="user" class="main.User.JDBCOperater"> <property name="dataSource" ref="dataSource"/> </bean> <bean id="login" class="main.User.JDBCOperater"> <property name="dataSource" ref="dataSource"/> </bean> <bean id="JdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" abstract="false" lazy-init="false"> <property name="dataSource" ref="dataSource" /> </bean> </beans> ``` 登陆界面login.jsp ``` <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>登陆</title> </head> <body> <h2>登陆</h2> <h2>用户信息</h2> <form:form method="POST" action="/login"> <table> <tr> <td><form:label path="name">姓名:</form:label></td> <td><form:input path="name"/></td> </tr> <tr> <td><form:label path="password">密码:</form:label></td> <td><form:input path="password"/></td> </tr> <tr> <td colspan="2"><input type="submit" value="登陆"/></td> </tr> </table> </form:form> </body> </html> ``` 报错 ``` java.lang.IllegalArgumentException: No DataSource specified at org.springframework.util.Assert.notNull(Assert.java:134) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:97) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:625) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:690) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:722) at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:732) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:800) at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:819) at main.User.JDBCOperater.getMatchCode(JDBCOperater.java:77) at main.User.UserController.login(UserController.java:53) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:181) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:440) at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:428) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) ``` 万分感谢!

ssh框架登录报404求大神解答!!!

我的源码: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext.xml</param-value> </context-param> <description>Spring 配置文件位置</description> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>login.jsp</welcome-file> </welcome-file-list> </web-app> applicationContext.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" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <!-- 数据源 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="username" value="root" /> <property name="password" value="123456" /> <property name="url" value="jdbc:mysql://localhost:3306/test"></property> </bean> <!-- session factory --> <!-- session factory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop> <prop key="hibernate.show_sql">true</prop> </props> </property> <property name="mappingResources"> <list> <value>com/entity/User.hbm.xml</value> </list> </property> </bean> <!-- 把DAO注入给Session工厂 --> <bean id="UserDao" class="com.dao.UserDao"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <!-- 把Service注入给DAO --> <bean id="LoginService" class="com.service.LoginService"> <property name="userDao"> <ref local="UserDao" /> </property> </bean> <!-- 把Action注入给Service property name对应的是action里面的属性svc--> <bean name="LoginAction" class="com.action.LoginAction"> <property name="svc"> <ref bean="LoginService" /> </property> </bean> </beans> struts.xml配置 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="login" extends="struts-default" namespace="/"> <action name="login" class="LoginAction"> <result name="success">/success.jsp</result> <result name="error">/login.jsp</result> </action> </package> </struts> User.java package com.entity; import java.io.Serializable; public class User implements Serializable { private Integer id; private String username; private String password; public User(){} public User(String username,String password){ this.username=username; this.password=password; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } /** * @return the password */ public String getPassword() { return password; } /** * @param password the password to set */ public void setPassword(String password) { this.password = password; } } User.hbm.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="com.entity.User" table="info" catalog="test"> <id name="id" type="java.lang.Integer"> <column name="id" /> <generator class="increment"></generator> </id> <property name="username" type="java.lang.String"> <column name="username" length="32" not-null="true" /> </property> <property name="password" type="java.lang.String"> <column name="password" length="32" not-null="true" /> </property> </class> </hibernate-mapping> UserDao.java package com.dao; import java.util.List; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; import com.entity.User; public class UserDao extends HibernateDaoSupport { public void save(User user) { this.getHibernateTemplate().save(user); } public void update(User user) { this.getHibernateTemplate().update(user); } public void delete(User user) { this.getHibernateTemplate().delete(user); } public User getByPk(int pk) { List list = this.getHibernateTemplate().find("from User where id=" + pk); if (list.isEmpty()) { return null; } return (User) list.get(0); } public User getByUserName(String username) { List list = this.getHibernateTemplate().find("from User where username" + username+""); if (list.size()==0) { return null; } return (User) list.get(0); } } LoginService.java package com.service; import com.dao.UserDao; import com.entity.User; public class LoginService { private UserDao userDao; public String login(String username, String password) { User user = userDao.getByUserName(username); if (null != user) { if (password.equals(user.getPassword())) { return "success"; } else { return "密码错误"; } } else { return "用户不存在"; } } public UserDao getUserDao() { return userDao; } public void setUserDao(UserDao userDao) { this.userDao = userDao; } } LoginAction.java package com.action; import com.opensymphony.xwork2.ActionSupport; import com.service.LoginService; public class LoginAction extends ActionSupport { private String username; private String password; private LoginService svc; public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public LoginService getSvc() { return svc; } public void setSvc(LoginService svc) { this.svc = svc; } public String execute() { if (null == username || username.equals("")) { return ""; } String info = svc.login(username, password); if (info.equals("success")) { return "success"; } System.out.println(info); return "error"; } } login.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <form action="LoginAction" method="post"> 用户:<input type="text" name="username"><br> 密码:<input type="password" name="password"><br> <input type="submit" value="登录"><br> </form> </body> </html> success.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@taglib prefix="s" uri="/struts-tags" %> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>登录成功页面</title> </head> <body> <h1>登录成功!</h1> </body> </html>

在阿里云上部署java项目后,浏览器访问不了?

在阿里云上部署java项目后,用浏览器访问网页显示如下错误:![图片说明](https://img-ask.csdn.net/upload/201903/14/1552556167_258315.png) 声明: 在网上也查了许多资料: 1,有说是阿里云安全规则配置哪里没设置![图片说明](https://img-ask.csdn.net/upload/201903/14/1552556313_933513.png)![图片说明](https://img-ask.csdn.net/upload/201903/14/1552556324_255015.png)![图片说明](https://img-ask.csdn.net/upload/201903/14/1552556330_9396.png) 可是还是没用 2,然后根据网上说的看下tomcat日志: ``` Using CATALINA_BASE: /usr/java/tomcat7 Using CATALINA_HOME: /usr/java/tomcat7 Using CATALINA_TMPDIR: /usr/java/tomcat7/temp Using JRE_HOME: /usr Using CLASSPATH: /usr/java/tomcat7/bin/bootstrap.jar:/usr/java/tomcat7/bin/tomcat-juli.jar Mar 14, 2019 2:56:22 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server version: Apache Tomcat/7.0.93 Mar 14, 2019 2:56:22 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server built: Feb 16 2019 17:13:17 UTC Mar 14, 2019 2:56:22 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Server number: 7.0.93.0 Mar 14, 2019 2:56:22 PM org.apache.catalina.startup.VersionLoggerListener log INFO: OS Name: Linux Mar 14, 2019 2:56:22 PM org.apache.catalina.startup.VersionLoggerListener log INFO: OS Version: 2.6.32-754.11.1.el6.x86_64 Mar 14, 2019 2:56:22 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Architecture: amd64 Mar 14, 2019 2:56:22 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Java Home: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.211.x86_64/jre Mar 14, 2019 2:56:22 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Version: 1.7.0_211-mockbuild_2019_03_11_17_56-b00 Mar 14, 2019 2:56:22 PM org.apache.catalina.startup.VersionLoggerListener log INFO: JVM Vendor: Oracle Corporation Mar 14, 2019 2:56:22 PM org.apache.catalina.startup.VersionLoggerListener log INFO: CATALINA_BASE: /usr/java/tomcat7 Mar 14, 2019 2:56:22 PM org.apache.catalina.startup.VersionLoggerListener log INFO: CATALINA_HOME: /usr/java/tomcat7 Mar 14, 2019 2:56:23 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.util.logging.config.file=/usr/java/tomcat7/conf/logging.properties Mar 14, 2019 2:56:23 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager Mar 14, 2019 2:56:23 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 Mar 14, 2019 2:56:23 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dignore.endorsed.dirs= Mar 14, 2019 2:56:23 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dcatalina.base=/usr/java/tomcat7 Mar 14, 2019 2:56:23 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Dcatalina.home=/usr/java/tomcat7 Mar 14, 2019 2:56:23 PM org.apache.catalina.startup.VersionLoggerListener log INFO: Command line argument: -Djava.io.tmpdir=/usr/java/tomcat7/temp Mar 14, 2019 2:56:23 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib Mar 14, 2019 2:56:23 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["http-bio-8080"] Mar 14, 2019 2:56:23 PM org.apache.coyote.AbstractProtocol init SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-bio-8080"] java.net.BindException: Address already in use (Bind failed) <null>:8080 at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:414) at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:728) at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:452) at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119) at org.apache.catalina.connector.Connector.initInternal(Connector.java:978) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:560) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:840) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) at org.apache.catalina.startup.Catalina.load(Catalina.java:660) at org.apache.catalina.startup.Catalina.load(Catalina.java:685) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:253) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427) Caused by: java.net.BindException: Address already in use (Bind failed) at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376) at java.net.ServerSocket.bind(ServerSocket.java:375) at java.net.ServerSocket.<init>(ServerSocket.java:237) at java.net.ServerSocket.<init>(ServerSocket.java:181) at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:49) at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:401) ... 17 more Mar 14, 2019 2:56:23 PM org.apache.catalina.core.StandardService initInternal SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8080]] org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-8080]] at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:560) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:840) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) at org.apache.catalina.startup.Catalina.load(Catalina.java:660) at org.apache.catalina.startup.Catalina.load(Catalina.java:685) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:253) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427) Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed at org.apache.catalina.connector.Connector.initInternal(Connector.java:980) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) ... 12 more Caused by: java.net.BindException: Address already in use (Bind failed) <null>:8080 at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:414) at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:728) at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:452) at org.apache.coyote.http11.AbstractHttp11JsseProtocol.init(AbstractHttp11JsseProtocol.java:119) at org.apache.catalina.connector.Connector.initInternal(Connector.java:978) ... 13 more Caused by: java.net.BindException: Address already in use (Bind failed) at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376) at java.net.ServerSocket.bind(ServerSocket.java:375) at java.net.ServerSocket.<init>(ServerSocket.java:237) at java.net.ServerSocket.<init>(ServerSocket.java:181) at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:49) at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:401) ... 17 more Mar 14, 2019 2:56:23 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["ajp-bio-8009"] Mar 14, 2019 2:56:23 PM org.apache.coyote.AbstractProtocol init SEVERE: Failed to initialize end point associated with ProtocolHandler ["ajp-bio-8009"] java.net.BindException: Address already in use (Bind failed) <null>:8009 at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:414) at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:728) at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:452) at org.apache.catalina.connector.Connector.initInternal(Connector.java:978) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:560) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:840) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) at org.apache.catalina.startup.Catalina.load(Catalina.java:660) at org.apache.catalina.startup.Catalina.load(Catalina.java:685) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:253) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427) Caused by: java.net.BindException: Address already in use (Bind failed) at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376) at java.net.ServerSocket.bind(ServerSocket.java:375) at java.net.ServerSocket.<init>(ServerSocket.java:237) at java.net.ServerSocket.<init>(ServerSocket.java:181) at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:49) at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:401) ... 16 more Mar 14, 2019 2:56:23 PM org.apache.catalina.core.StandardService initInternal SEVERE: Failed to initialize connector [Connector[AJP/1.3-8009]] org.apache.catalina.LifecycleException: Failed to initialize component [Connector[AJP/1.3-8009]] at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:107) at org.apache.catalina.core.StandardService.initInternal(StandardService.java:560) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:840) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) at org.apache.catalina.startup.Catalina.load(Catalina.java:660) at org.apache.catalina.startup.Catalina.load(Catalina.java:685) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:253) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:427) Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed at org.apache.catalina.connector.Connector.initInternal(Connector.java:980) at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102) ... 12 more Caused by: java.net.BindException: Address already in use (Bind failed) <null>:8009 at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:414) at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:728) at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:452) at org.apache.catalina.connector.Connector.initInternal(Connector.java:978) ... 13 more Caused by: java.net.BindException: Address already in use (Bind failed) at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376) at java.net.ServerSocket.bind(ServerSocket.java:375) at java.net.ServerSocket.<init>(ServerSocket.java:237) at java.net.ServerSocket.<init>(ServerSocket.java:181) at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:49) at org.apache.tomcat.util.net.JIoEndpoint.bind(JIoEndpoint.java:401) ... 16 more Mar 14, 2019 2:56:23 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 1420 ms Mar 14, 2019 2:56:23 PM org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina Mar 14, 2019 2:56:23 PM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.93 Mar 14, 2019 2:56:23 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive /usr/java/tomcat7/webapps/survey.war Mar 14, 2019 2:56:23 PM org.apache.catalina.loader.WebappClassLoaderBase validateJarFile INFO: validateJarFile(/usr/java/tomcat7/webapps/survey/WEB-INF/lib/servlet-api.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class Mar 14, 2019 2:56:24 PM org.apache.catalina.deploy.WebXml setVersion WARNING: Unknown version string [3.1]. Default version will be used. Mar 14, 2019 2:56:25 PM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jstl/core is already defined Mar 14, 2019 2:56:25 PM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jstl/fmt is already defined Mar 14, 2019 2:56:25 PM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jstl/sql is already defined Mar 14, 2019 2:56:25 PM org.apache.catalina.startup.TaglibUriRule body INFO: TLD skipped. URI: http://java.sun.com/jstl/xml is already defined Mar 14, 2019 2:56:26 PM org.apache.catalina.startup.TldConfig execute INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. Mar 14, 2019 2:56:26 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Parsing configuration file [struts-default.xml] Mar 14, 2019 2:56:26 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Unable to locate configuration files of the name struts-plugin.xml, skipping Mar 14, 2019 2:56:26 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Parsing configuration file [struts-plugin.xml] Mar 14, 2019 2:56:26 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Parsing configuration file [struts.xml] Mar 14, 2019 2:56:26 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (com.opensymphony.xwork2.ObjectFactory) Mar 14, 2019 2:56:26 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (com.opensymphony.xwork2.FileManager) Mar 14, 2019 2:56:26 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.XWorkConverter) Mar 14, 2019 2:56:26 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (com.opensymphony.xwork2.TextProvider) Mar 14, 2019 2:56:26 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (com.opensymphony.xwork2.ActionProxyFactory) Mar 14, 2019 2:56:26 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ObjectTypeDeterminer) Mar 14, 2019 2:56:26 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (org.apache.struts2.dispatcher.mapper.ActionMapper) Mar 14, 2019 2:56:26 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (jakarta) for (org.apache.struts2.dispatcher.multipart.MultiPartRequest) Mar 14, 2019 2:56:26 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (org.apache.struts2.views.freemarker.FreemarkerManager) Mar 14, 2019 2:56:27 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (org.apache.struts2.components.UrlRenderer) Mar 14, 2019 2:56:27 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (com.opensymphony.xwork2.validator.ActionValidatorManager) Mar 14, 2019 2:56:27 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (com.opensymphony.xwork2.util.ValueStackFactory) Mar 14, 2019 2:56:27 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (com.opensymphony.xwork2.util.reflection.ReflectionProvider) Mar 14, 2019 2:56:27 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (com.opensymphony.xwork2.util.reflection.ReflectionContextFactory) Mar 14, 2019 2:56:27 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (com.opensymphony.xwork2.util.PatternMatcher) Mar 14, 2019 2:56:27 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (org.apache.struts2.dispatcher.StaticContentLoader) Mar 14, 2019 2:56:27 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (com.opensymphony.xwork2.UnknownHandlerManager) Mar 14, 2019 2:56:27 PM com.opensymphony.xwork2.util.logging.jdk.JdkLogger info INFO: Choosing bean (struts) for (org.apache.struts2.views.util.UrlHelper) Mar 14, 2019 2:56:27 PM org.apache.catalina.core.StandardContext startInternal SEVERE: One or more Filters failed to start. Full details will be found in the appropriate container log file Mar 14, 2019 2:56:27 PM org.apache.catalina.core.StandardContext startInternal SEVERE: Context [/survey] startup failed due to previous errors Mar 14, 2019 2:56:27 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deployment of web application archive /usr/java/tomcat7/webapps/survey.war has finished in 3,963 ms Mar 14, 2019 2:56:27 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 4088 ms Mar 14, 2019 2:56:27 PM org.apache.catalina.core.StandardServer await SEVERE: StandardServer.await: create[localhost:8005]: java.net.BindException: Address already in use (Bind failed) at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376) at java.net.ServerSocket.bind(ServerSocket.java:375) at java.net.ServerSocket.<init>(ServerSocket.java:237) at org.apache.catalina.core.StandardServer.await(StandardServer.java:444) at org.apache.catalina.startup.Catalina.await(Catalina.java:799) at org.apache.catalina.startup.Catalina.start(Catalina.java:745) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:428) Mar 14, 2019 2:56:27 PM org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["http-bio-8080"] Mar 14, 2019 2:56:27 PM org.apache.coyote.AbstractProtocol pause INFO: Pausing ProtocolHandler ["ajp-bio-8009"] Mar 14, 2019 2:56:27 PM org.apache.catalina.core.StandardService stopInternal INFO: Stopping service Catalina Mar 14, 2019 2:56:27 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["http-bio-8080"] Mar 14, 2019 2:56:27 PM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["http-bio-8080"] Mar 14, 2019 2:56:27 PM org.apache.coyote.AbstractProtocol stop INFO: Stopping ProtocolHandler ["ajp-bio-8009"] Mar 14, 2019 2:56:27 PM org.apache.coyote.AbstractProtocol destroy INFO: Destroying ProtocolHandler ["ajp-bio-8009"] ``` 看了下是说tomcat端口占用? 杀掉tomcat后还是没作用 求各位大佬帮个帮忙 谢谢

Log4j2启动报错,ava.lang.NoSuchMethodError

Caused by: java.lang.NoSuchMethodError: org.apache.logging.log4j.core.util.FileUtils.getCorrectedFilePathUri(Ljava/lang/String;)Ljava/net/URI; at org.apache.logging.log4j.web.Log4jWebInitializerImpl.getConfigURI(Log4jWebInitializerImpl.java:193) at org.apache.logging.log4j.web.Log4jWebInitializerImpl.initializeNonJndi(Log4jWebInitializerImpl.java:156) at org.apache.logging.log4j.web.Log4jWebInitializerImpl.start(Log4jWebInitializerImpl.java:107) at org.apache.logging.log4j.web.Log4jServletContainerInitializer.onStartup(Log4jServletContainerInitializer.java:57) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5669) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) ... 42 more Jul 02, 2018 1:19:18 PM org.apache.tomcat.util.modeler.BaseModelMBean invoke 严重: Exception invoking method manageApp java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1021) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:993) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1900) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:835) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Jul 02, 2018 1:19:18 PM org.apache.tomcat.util.modeler.BaseModelMBean invoke 严重: Exception invoking method createStandardContext javax.management.RuntimeOperationsException: Exception invoking method manageApp at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:309) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618) at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357) at sun.rmi.transport.Transport$1.run(Transport.java:200) at sun.rmi.transport.Transport$1.run(Transport.java:197) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.Transport.serviceCall(Transport.java:196) at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:835) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688) at java.security.AccessController.doPrivileged(Native Method) at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1021) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:993) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1900) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301) ... 33 more Jul 02, 2018 1:19:23 PM org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory /usr/local/apache-tomcat-7.0.88/webapps/manager Jul 02, 2018 1:19:23 PM org.apache.catalina.startup.TldConfig execute ``` ``` 下面是pom文件 ``` <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 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.konglin</groupId> <artifactId>SmartCompus</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>SmartCompus Maven Webapp</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <spring.version>4.2.5.RELEASE</spring.version> <mybatis.version>3.2.8</mybatis.version> <slf4j.version>1.7.18</slf4j.version> <log4j.version>2.5</log4j.version> <mysql.driver.version>5.1.21</mysql.driver.version> <commons-fileupload.version>1.3</commons-fileupload.version> <servlet.version>3.1.0</servlet.version> <spring-mybatis.version>1.2.2</spring-mybatis.version> <fastjson.version>1.1.41</fastjson.version> <jackson.version>2.3.0</jackson.version> <quartz.versison>1.8.5</quartz.versison> <httpclient.version>3.1</httpclient.version> <jstl.version>1.2</jstl.version> <shiro.version>1.2.3</shiro.version> <lombok.version>1.16.18</lombok.version> <json.version>2.4</json.version> <poi.version>3.14</poi.version> <gexin.http.version>4.0.1.17</gexin.http.version> <maven.pluin.version>2.5.2</maven.pluin.version> </properties> <dependencies> <!--servlet--> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>${servlet.version}</version> </dependency> <!--spring--> <!--核心--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.version}</version> </dependency> <!--dao--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>${spring.version}</version> </dependency> <!--web--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <!--test--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${spring.version}</version> </dependency> <!--mybatis--> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>${mybatis.version}</version> </dependency> <!-- 添加mybatis/spring整合包依赖 --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>${spring-mybatis.version}</version> </dependency> <!-- jdbc driver --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${mysql.driver.version}</version> <scope>runtime</scope> </dependency> <!--log4j--> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>${log4j.version}</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>${log4j.version}</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-web</artifactId> <version>${log4j.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>${slf4j.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>${slf4j.version}</version> </dependency> <!--alibaba Json--> <dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>${fastjson.version}</version> </dependency> <!--jackson Json--> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>${jackson.version}</version> </dependency> <!--quartz--> <dependency> <groupId>org.quartz-scheduler</groupId> <artifactId>quartz</artifactId> <version>${quartz.versison}</version> </dependency> <!-- https://mvnrepository.com/artifact/commons-httpclient/commons-httpclient --> <dependency> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId> <version>${httpclient.version}</version> </dependency> <!-- 添加jstl依赖 --> <dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId> <version>${jstl.version}</version> </dependency> <!-- shiro --> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-all</artifactId> <version>${shiro.version}</version> </dependency> <!--lombok--> <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>${lombok.version}</version> <scope>provided</scope> </dependency> <!-- https://mvnrepository.com/artifact/net.sf.json-lib/json-lib --> <!--必须添加jdk1,否则编译不通过》--> <dependency> <groupId>net.sf.json-lib</groupId> <artifactId>json-lib</artifactId> <version>${json.version}</version> <classifier>jdk15</classifier> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml --> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>${poi.version}</version> </dependency> <!--gexin--> <dependency> <groupId>com.gexin.platform</groupId> <artifactId>gexin-rp-sdk-http</artifactId> <version>${gexin.http.version}</version> </dependency> <!--maven.plugins--> <dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-release-plugin</artifactId> <version>${maven.pluin.version}</version> </dependency> </dependencies> <repositories> <repository> <id>getui-nexus</id> <url>http://mvn.gt.igexin.com/nexus/content/repositories/releases/</url> </repository> </repositories> <build> <finalName>SmartCompus</finalName> <plugins> <plugin> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin</artifactId> <version>1.3.1</version> <configuration> <verbose>true</verbose> <overwrite>true</overwrite> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> <resources> <resource> <directory>src/main/resources</directory> </resource> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> <filtering>true</filtering> </resource> </resources> </build> </project> ``` 下面是控制的日志 ``` Connected to server [2018-07-02 06:46:01,281] Artifact SmartCompus:war exploded: Artifact is being deployed, please wait... Jul 02, 2018 6:46:01 PM org.apache.catalina.loader.WebappClassLoaderBase validateJarFile 信息: validateJarFile(/Users/albert/Workspace/IDEA/SmartCompus/target/SmartCompus/WEB-INF/lib/javax.servlet-api-3.1.0.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class Jul 02, 2018 6:46:06 PM org.apache.catalina.startup.TldConfig execute 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/Users/albert/Workspace/IDEA/SmartCompus/target/SmartCompus/WEB-INF/lib/slf4j-jdk14-1.5.6.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/Users/albert/Workspace/IDEA/SmartCompus/target/SmartCompus/WEB-INF/lib/slf4j-log4j12-1.7.18.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/Users/albert/Workspace/IDEA/SmartCompus/target/SmartCompus/WEB-INF/lib/slf4j-nop-1.5.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: The requested version 1.5.6 by your slf4j binding is not compatible with [1.6] SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details. Jul 02, 2018 6:46:07 PM org.apache.catalina.core.StandardContext startInternal 严重: One or more listeners failed to start. Full details will be found in the appropriate container log file Jul 02, 2018 6:46:07 PM org.apache.catalina.core.StandardContext startInternal 严重: Context [] startup failed due to previous errors [2018-07-02 06:46:07,299] Artifact SmartCompus:war exploded: Error during artifact deployment. See server log for details. Jul 02, 2018 6:46:11 PM org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory /usr/local/apache-tomcat-7.0.88/webapps/manager Jul 02, 2018 6:46:11 PM org.apache.catalina.startup.TldConfig execute 信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. Jul 02, 2018 6:46:11 PM org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory /usr/local/apache-tomcat-7.0.88/webapps/manager has finished in 271 ms ```

定量遥感中文版 梁顺林著 范闻捷译

这是梁顺林的定量遥感的中文版,由范闻捷等翻译的,是电子版PDF,解决了大家看英文费时费事的问题,希望大家下载看看,一定会有帮助的

Java 最常见的 200+ 面试题:面试必备

这份面试清单是从我 2015 年做了 TeamLeader 之后开始收集的,一方面是给公司招聘用,另一方面是想用它来挖掘在 Java 技术栈中,还有那些知识点是我不知道的,我想找到这些技术盲点,然后修复它,以此来提高自己的技术水平。虽然我是从 2009 年就开始参加编程工作了,但我依旧觉得自己现在要学的东西很多,并且学习这些知识,让我很有成就感和满足感,那所以何乐而不为呢? 说回面试的事,这份面试...

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

远程工具,免费

远程工具,免费

java jdk 8 帮助文档 中文 文档 chm 谷歌翻译

JDK1.8 API 中文谷歌翻译版 java帮助文档 JDK API java 帮助文档 谷歌翻译 JDK1.8 API 中文 谷歌翻译版 java帮助文档 Java最新帮助文档 本帮助文档是使用谷

csma/ca和csma/cd的matlab仿真源代码带有详细的注释

csma/ca和csma/cd的matlab仿真源代码带有详细的注释,载波侦听,随意设置节点数,带有炫酷的图形展示效果。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

软件测试入门、SQL、性能测试、测试管理工具

软件测试2小时入门,让您快速了解软件测试基本知识,有系统的了解; SQL一小时,让您快速理解和掌握SQL基本语法 jmeter性能测试 ,让您快速了解主流来源性能测试工具jmeter 测试管理工具-禅道,让您快速学会禅道的使用,学会测试项目、用例、缺陷的管理、

pokemmo的资源

pokemmo必须的4个rom 分别为绿宝石 火红 心金 黑白 还有汉化补丁 资源不错哦 记得下载

三个项目玩转深度学习(附1G源码)

从事大数据与人工智能开发与实践约十年,钱老师亲自见证了大数据行业的发展与人工智能的从冷到热。事实证明,计算机技术的发展,算力突破,海量数据,机器人技术等,开启了第四次工业革命的序章。深度学习图像分类一直是人工智能的经典任务,是智慧零售、安防、无人驾驶等机器视觉应用领域的核心技术之一,掌握图像分类技术是机器视觉学习的重中之重。针对现有线上学习的特点与实际需求,我们开发了人工智能案例实战系列课程。打造:以项目案例实践为驱动的课程学习方式,覆盖了智能零售,智慧交通等常见领域,通过基础学习、项目案例实践、社群答疑,三维立体的方式,打造最好的学习效果。

无线通信中的智能天线:IS-95和第3代CDMA应用_.pdf

无线通信中的智能天线:IS-95和第3代CDMA应用_.pdf

设计模式(JAVA语言实现)--20种设计模式附带源码

课程亮点: 课程培训详细的笔记以及实例代码,让学员开始掌握设计模式知识点 课程内容: 工厂模式、桥接模式、组合模式、装饰器模式、外观模式、享元模式、原型模型、代理模式、单例模式、适配器模式 策略模式、模板方法模式、观察者模式、迭代器模式、责任链模式、命令模式、备忘录模式、状态模式、访问者模式 课程特色: 笔记设计模式,用笔记串连所有知识点,让学员从一点一滴积累,学习过程无压力 笔记标题采用关键字标识法,帮助学员更加容易记住知识点 笔记以超链接形式让知识点关联起来,形式知识体系 采用先概念后实例再应用方式,知识点深入浅出 提供授课内容笔记作为课后复习以及工作备查工具 部分图表(电脑PC端查看):

Java8零基础入门视频教程

这门课程基于主流的java8平台,由浅入深的详细讲解了java SE的开发技术,可以使java方向的入门学员,快速扎实的掌握java开发技术!

玩转Linux:常用命令实例指南

人工智能、物联网、大数据时代,Linux正有着一统天下的趋势,几乎每个程序员岗位,都要求掌握Linux。本课程零基础也能轻松入门。 本课程以简洁易懂的语言手把手教你系统掌握日常所需的Linux知识,每个知识点都会配合案例实战让你融汇贯通。课程通俗易懂,简洁流畅,适合0基础以及对Linux掌握不熟练的人学习; 【限时福利】 1)购课后按提示添加小助手,进答疑群,还可获得价值300元的编程大礼包! 2)本月购买此套餐加入老师答疑交流群,可参加老师的免费分享活动,学习最新技术项目经验。 --------------------------------------------------------------- 29元=掌握Linux必修知识+社群答疑+讲师社群分享会+700元编程礼包。 &nbsp;

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

想学好JAVA必须要报两万的培训班吗? Java大神勿入 如果你: 零基础想学JAVA却不知道从何入手 看了一堆书和视频却还是连JAVA的环境都搭建不起来 囊中羞涩面对两万起的JAVA培训班不忍直视 在职没有每天大块的时间专门学习JAVA 那么恭喜你找到组织了,在这里有: 1. 一群志同道合立志学好JAVA的同学一起学习讨论JAVA 2. 灵活机动的学习时间完成特定学习任务+每日编程实战练习 3. 热心助人的助教和讲师及时帮你解决问题,不按时完成作业小心助教老师的家访哦 上一张图看看前辈的感悟: &nbsp; &nbsp; 大家一定迫不及待想知道什么是极简JAVA学习营了吧,下面就来给大家说道说道: 什么是极简JAVA学习营? 1. 针对Java小白或者初级Java学习者; 2. 利用9天时间,每天1个小时时间; 3.通过 每日作业 / 组队PK / 助教答疑 / 实战编程 / 项目答辩 / 社群讨论 / 趣味知识抢答等方式让学员爱上学习编程 , 最终实现能独立开发一个基于控制台的‘库存管理系统’ 的学习模式 极简JAVA学习营是怎么学习的? &nbsp; 如何报名? 只要购买了极简JAVA一:JAVA入门就算报名成功! &nbsp;本期为第四期极简JAVA学习营,我们来看看往期学员的学习状态: 作业看这里~ &nbsp; 助教的作业报告是不是很专业 不交作业打屁屁 助教答疑是不是很用心 &nbsp; 有奖抢答大家玩的很嗨啊 &nbsp; &nbsp; 项目答辩终于开始啦 &nbsp; 优秀者的获奖感言 &nbsp; 这是答辩项目的效果 &nbsp; &nbsp; 这么细致的服务,这么好的氛围,这样的学习效果,需要多少钱呢? 不要1999,不要199,不要99,只要9.9 是的你没听错,只要9.9以上所有就都属于你了 如果你: 1、&nbsp;想学JAVA没有基础 2、&nbsp;想学JAVA没有整块的时间 3、&nbsp;想学JAVA没有足够的预算 还等什么?赶紧报名吧,抓紧抢位,本期只招300人,错过只有等时间待定的下一期了 &nbsp; 报名请加小助手微信:eduxy-1 &nbsp; &nbsp;

Python数据清洗实战入门

本次课程主要以真实的电商数据为基础,通过Python详细的介绍了数据分析中的数据清洗阶段各种技巧和方法。

董付国老师Python全栈学习优惠套餐

购买套餐的朋友可以关注微信公众号“Python小屋”,上传付款截图,然后领取董老师任意图书1本。

linux下利用/proc进行进程树的打印

在linux下利用c语言实现的进程树的打印,主要通过/proc下的目录中的进程文件,获取status中的进程信息内容,然后利用递归实现进程树的打印

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

HoloLens2开发入门教程

本课程为HoloLens2开发入门教程,讲解部署开发环境,安装VS2019,Unity版本,Windows SDK,创建Unity项目,讲解如何使用MRTK,编辑器模拟手势交互,打包VS工程并编译部署应用到HoloLens上等。

150讲轻松搞定Python网络爬虫

【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑

MySQL 8.0.19安装教程(windows 64位)

话不多说直接开干 目录 1-先去官网下载点击的MySQL的下载​ 2-配置初始化的my.ini文件的文件 3-初始化MySQL 4-安装MySQL服务 + 启动MySQL 服务 5-连接MySQL + 修改密码 先去官网下载点击的MySQL的下载 下载完成后解压 解压完是这个样子 配置初始化的my.ini文件的文件 ...

Python数据挖掘简易入门

&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

网络工程师小白入门--【思科CCNA、华为HCNA等网络工程师认证】

本课程适合CCNA或HCNA网络小白同志,高手请绕道,可以直接学习进价课程。通过本预科课程的学习,为学习网络工程师、思科CCNA、华为HCNA这些认证打下坚实的基础! 重要!思科认证2020年2月24日起,已启用新版认证和考试,包括题库都会更新,由于疫情原因,请关注官网和本地考点信息。题库网络上很容易下载到。

Ubuntu18.04安装教程

Ubuntu18.04.1安装一、准备工作1.下载Ubuntu18.04.1 LTS2.制作U盘启动盘3.准备 Ubuntu18.04.1 的硬盘空间二、安装Ubuntu18.04.1三、安装后的一些工作1.安装输入法2.更换软件源四、双系统如何卸载Ubuntu18.04.1新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列...

sql语句 异常 Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your

在我们开发的工程中,有时候会报 [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ------ 这种异常 不用多想,肯定是我们的sql语句出现问题,下面...

西南交通大学新秀杯数学建模试题

题目比较难,如果符合大家的口味欢迎大家下载哈,提高你的思维想象能力

Windows版YOLOv4目标检测实战:训练自己的数据集

课程演示环境:Windows10; cuda 10.2; cudnn7.6.5; Python3.7; VisualStudio2019; OpenCV3.4 需要学习ubuntu系统上YOLOv4的同学请前往:《YOLOv4目标检测实战:训练自己的数据集》 课程链接:https://edu.csdn.net/course/detail/28745 YOLOv4来了!速度和精度双提升! 与 YOLOv3 相比,新版本的 AP (精度)和 FPS (每秒帧率)分别提高了 10% 和 12%。 YOLO系列是基于深度学习的端到端实时目标检测方法。本课程将手把手地教大家使用labelImg标注和使用YOLOv4训练自己的数据集。课程实战分为两个项目:单目标检测(足球目标检测)和多目标检测(足球和梅西同时检测)。 本课程的YOLOv4使用AlexyAB/darknet,在Windows系统上做项目演示。包括:安装软件环境、安装YOLOv4、标注自己的数据集、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算)和先验框聚类分析。还将介绍改善YOLOv4目标检测性能的技巧。 除本课程《Windows版YOLOv4目标检测实战:训练自己的数据集》外,本人将推出有关YOLOv4目标检测的系列课程。请持续关注该系列的其它视频课程,包括: 《Windows版YOLOv4目标检测实战:人脸口罩佩戴检测》 《Windows版YOLOv4目标检测实战:中国交通标志识别》 《Windows版YOLOv4目标检测:原理与源码解析》

Spring Boot -01- 快速入门篇(图文教程)

Spring Boot -01- 快速入门篇 今天开始不断整理 Spring Boot 2.0 版本学习笔记,大家可以在博客看到我的笔记,然后大家想看视频课程也可以到【慕课网】手机 app,去找【Spring Boot 2.0 深度实践】的课程,令人开心的是,课程完全免费! 什么是 Spring Boot? Spring Boot 是由 Pivotal 团队提供的全新框架。Spring Boot...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

C/C++学习指南全套教程

C/C++学习的全套教程,从基本语法,基本原理,到界面开发、网络开发、Linux开发、安全算法,应用尽用。由毕业于清华大学的业内人士执课,为C/C++编程爱好者的教程。

winfrom中嵌套html,跟html的交互

winfrom中嵌套html,跟html的交互,源码就在里面一看就懂,很简单

相关热词 c#设计思想 c#正则表达式 转换 c#form复制 c#写web c# 柱形图 c# wcf 服务库 c#应用程序管理器 c#数组如何赋值给数组 c#序列化应用目的博客园 c# 设置当前标注样式
立即提问