web项目在eclipse里面运行报404错误

web项目放到 TOMCATHOME%/wewebapps路径 里面运行没问题,但是放到eclipse里面报404。我首先在根目录写好一个index.jsp可以测试成功。但是我运行另一个.jsp,
就提示404.如图 图片说明
我的.jsp里面只有这一句:
这怎么解决?路径肯定是没有问题的。网上说是eclipse配置问题我也照做了还是不行,求大神帮忙。谢谢。
图片说明

qq_44045573
哼哼大王 原因是在Eclipse中Webapp是存放在WebContent里面,我们只需把WebRoot里面的文件全部拷贝一份到WebContent下面,这样我们就可以在Eclipse中运行导入的MyEllipse项目了
大约 2 个月之前 回复

8个回答

两个web_inf,由于该文件是系统调用的,不能直接请求该文件下的页面,可以通过转发的方式访问该页面。,所以文由于件名不能将web~inf再次作为文件夹。希望你能采纳,谢谢

怎么有两个WEB-INF?,一个在表面而另一个在WebContent里面?问题一定是出在这里

你要是把WebContent改为web说不定就好了。其实就是images、WEB-INF、META-INF放进web中

2个WEB-INF肯定有问题的

感觉楼上说的挺对的,不过感觉为啥不用myeclipse。。。这个好用啊

WEB-INF里的jsp页面是被保护的 直接访问会出错 应该通过后台访问

兄弟 你是这里没有main.jsp啊 你把index1.jsp改为main.jsp

远程我给你弄,弄好了把分给我

xfjjs_net
xfjs江城子 会安卓嘛,帮我看看。。。联系方式?
3 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
web程序在eclipse中运行报错404

javaweb项目,成功配置Tomcat,之前可以运行登录界面(index.jsp),其他界面的跳转实现不了(404错误),后来Tomcat服务器启动错误,按网上的方法改了server.xml文件中的context行为绝对路径,现在服务器可以启动,但是每个页面都报404错误,求解原因。 可能是web.xml文件有误,也可以是servlet代码部分有问题。 附上各部分代码和目录: web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" 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_3_0.xsd"> <display-name></display-name> <servlet> <description>This is the description of my J2EE component</description> <display-name>This is the display name of my J2EE component</display-name> <servlet-name>RegisterAction</servlet-name> <servlet-class>com.register.RegisterAction</servlet-class> </servlet> <servlet> <description>This is the description of my J2EE component</description> <display-name>This is the display name of my J2EE component</display-name> <servlet-name>LoginAction</servlet-name> <servlet-class>com.login.LoginAction</servlet-class> </servlet> <servlet> <description>This is the description of my J2EE component</description> <display-name>This is the display name of my J2EE component</display-name> <servlet-name>ProductAction</servlet-name> <servlet-class>com.product.ProductAction</servlet-class> </servlet> <servlet> <description>This is the description of my J2EE component</description> <display-name>This is the display name of my J2EE component</display-name> <servlet-name>LogoutAction</servlet-name> <servlet-class>com.logout.LogoutAction</servlet-class> </servlet> <servlet-mapping> <servlet-name>RegisterAction</servlet-name> <url-pattern>/servlet/RegisterAction</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>LoginAction</servlet-name> <url-pattern>/servlet/LoginAction</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>ProductAction</servlet-name> <url-pattern>/servlet/ProductAction</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>LogoutAction</servlet-name> <url-pattern>/servlet/LogoutAction</url-pattern> </servlet-mapping> <!-- 配置 过滤器 --> <filter> <filter-name>MyFilter</filter-name> <filter-class>com.filter.MyFilter</filter-class> </filter> <filter-mapping> <filter-name>MyFilter</filter-name> <!-- /*表示过滤所有页面 ,/main.jsp 表示只过滤main.jsp页面--> <url-pattern> /main.jsp</url-pattern> </filter-mapping> <filter-mapping> <filter-name>MyFilter</filter-name> <!-- /*表示过滤所有页面 /addProduct.jsp 表示只过滤addProduct.jsp页面--> <url-pattern>/addProduct.jsp</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> 小女子肝404错误熬了几个晚上了,大作业眼看就要交了,求大神解答~

web项目在eclipse中运行正常 部署到tomcat中运行报spring context错误

![图片说明](https://img-ask.csdn.net/upload/201603/19/1458396240_551101.jpg)

关于MyEclipse中Web新建项目运行后出现:404

各位大侠,本人刚学jsp,在自己的电脑上的MyEclipse里新建了个text项目,TOmcat运行没错,运行: http://localhost:8080正常出现界面,但是换成http://localhost:8080/text/index.jsp 就出现报错404,请各位大侠指教一下,谢谢!

项目部署了tomcat,项目也没有报错,但是在网页是却报404错误

![图片说明](https://img-ask.csdn.net/upload/201801/07/1515336873_507231.png)运行b.html却可以在网页显示出来 看下图 ![![![![![图片说明](https://img-ask.csdn.net/upload/201801/07/1515332826_400521.png)图片说明](https://img-ask.csdn.net/upload/201801/07/1515332818_700917.png)图片说明](https://img-ask.csdn.net/upload/201801/07/1515332811_585765.png)图片说明](https://img-ask.csdn.net/upload/201801/07/1515332800_981866.png)图片说明](https://img-ask.csdn.net/upload/201801/07/1515332794_385263.png)![![![![图片说明](https://img-ask.csdn.net/upload/201801/07/1515334156_618579.png)图片说明](https://img-ask.csdn.net/upload/201801/07/1515334145_142289.png)图片说明](https://img-ask.csdn.net/upload/201801/07/1515334124_348937.png)图片说明](https://img-ask.csdn.net/upload/201801/07/1515334109_638653.png)

哪位大神帮我解决一下eclipse运行突然报404,好像是spring配置文件有问题

七月 28, 2019 2:17:54 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:xuexiao' did not find a matching property. 七月 28, 2019 2:17:54 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:MyHRSht' did not find a matching property. 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server version: Apache Tomcat/8.5.34 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server built: Sep 4 2018 22:28:22 UTC 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server number: 8.5.34.0 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Name: Windows 10 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Version: 10.0 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Architecture: amd64 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Java Home: C:\Program Files\Java\jre1.8.0_201 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Version: 1.8.0_201-b09 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Vendor: Oracle Corporation 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_BASE: E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_HOME: E:\apache-tomcat-8.5.34-myeclipse 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.base=E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.home=E:\apache-tomcat-8.5.34-myeclipse 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dwtp.deploy=E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.endorsed.dirs=E:\apache-tomcat-8.5.34-myeclipse\endorsed 七月 28, 2019 2:17:54 下午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dfile.encoding=UTF-8 七月 28, 2019 2:17:54 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jre1.8.0_201\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_201/bin/server;C:/Program Files/Java/jre1.8.0_201/bin;C:/Program Files/Java/jre1.8.0_201/lib/amd64;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Java\jdk1.8.0_201\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Users\申红涛\AppData\Local\Microsoft\WindowsApps;;E:\eclipse;;.] 七月 28, 2019 2:17:55 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-nio-8083"] 七月 28, 2019 2:17:56 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 七月 28, 2019 2:17:57 下午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-nio-8039"] 七月 28, 2019 2:17:57 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector 信息: Using a shared selector for servlet write/read 七月 28, 2019 2:17:57 下午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 2984 ms 七月 28, 2019 2:17:57 下午 org.apache.catalina.core.StandardService startInternal 信息: Starting service [Catalina] 七月 28, 2019 2:17:57 下午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/8.5.34 七月 28, 2019 2:18:15 下午 org.apache.jasper.servlet.TldScanner scanJars 信息: 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. 七月 28, 2019 2:18:15 下午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 七月 28, 2019 2:18:15 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 七月 28, 2019 2:20:49 下午 org.apache.ibatis.mapping.VendorDatabaseIdProvider getDatabaseId 严重: Could not get a databaseId from dataSource java.sql.SQLException: Connections could not be acquired from the underlying database! at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:529) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128) at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseProductName(VendorDatabaseIdProvider.java:76) at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseName(VendorDatabaseIdProvider.java:61) at org.apache.ibatis.mapping.VendorDatabaseIdProvider.getDatabaseId(VendorDatabaseIdProvider.java:49) at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:395) at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:295) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source. at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1319) at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:557) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:477) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:525) ... 29 more 七月 28, 2019 2:20:50 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'springmvc' 七月 28, 2019 2:21:10 下午 org.apache.jasper.servlet.TldScanner scanJars 信息: 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. 七月 28, 2019 2:21:10 下午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 七月 28, 2019 2:21:10 下午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring root WebApplicationContext 2019-07-28 14:21:13 Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\xuexiao\WEB-INF\classes\springconfig\common.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:490) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:516) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:510) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1406) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1365) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) ... 20 more Caused by: java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.core.io.support.ResourceArrayPropertyEditor.setAsText(ResourceArrayPropertyEditor.java:135) at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:434) at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:406) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:163) at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:470) ... 26 more 七月 28, 2019 2:21:13 下午 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [E:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\xuexiao\WEB-INF\classes\springconfig\common.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.core.io.Resource[]' for property 'mapperLocations'; nested exception is java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:490) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:516) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:510) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1406) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1365) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) ... 20 more Caused by: java.lang.IllegalArgumentException: Could not resolve resource location pattern [dao/*.xml]: ServletContext resource [/dao/] cannot be resolved to URL because it does not exist at org.springframework.core.io.support.ResourceArrayPropertyEditor.setAsText(ResourceArrayPropertyEditor.java:135) at org.springframework.beans.TypeConverterDelegate.doConvertTextValue(TypeConverterDelegate.java:434) at org.springframework.beans.TypeConverterDelegate.doConvertValue(TypeConverterDelegate.java:406) at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:163) at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:470) ... 26 more 七月 28, 2019 2:21:13 下午 org.apache.catalina.core.StandardContext startInternal 严重: One or more listeners failed to start. Full details will be found in the appropriate container log file 七月 28, 2019 2:21:13 下午 org.apache.catalina.core.StandardContext startInternal 严重: Context [/xuexiao] startup failed due to previous errors 七月 28, 2019 2:21:13 下午 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 七月 28, 2019 2:21:14 下午 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks 严重: The web application [xuexiao] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5c5c779c]) and a value of type [java.lang.Class] (value [class oracle.sql.AnyDataFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 七月 28, 2019 2:21:14 下午 org.apache.catalina.loader.WebappClassLoaderBase checkThreadLocalMapForLeaks 严重: The web application [xuexiao] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@5c353122]) and a value of type [java.lang.Class] (value [class oracle.sql.TypeDescriptorFactory]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. 七月 28, 2019 2:21:14 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-nio-8083"] 七月 28, 2019 2:21:14 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["ajp-nio-8039"] 七月 28, 2019 2:21:14 下午 org.apache.catalina.startup.Catalina start 信息: Server startup in 197051 ms 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_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>SpringMybatisOa</display-name> <!-- dwr --> <servlet> <servlet-name>dwr_invoker</servlet-name> <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class> <init-param> <param-name>crossDomainSessionSecurity</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>dwr_invoker</servlet-name> <url-pattern>/dwre/*</url-pattern> </servlet-mapping> <filter> <filter-name>encodingFilter</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>encodingFilter</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:springconfig/*</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>springmvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springmvc</servlet-name> <url-pattern>*.action</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.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:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" 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/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations" value="classpath:jdbc.properties"></property> </bean> <bean id="ds" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="${driverClass}" /> <property name="jdbcUrl" value="${url}" /> <property name="user" value="${userName}" /> <property name="password" value="${passWord}" /> </bean> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="ds" /> </bean> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="ds" /> <!-- 自动扫描mapping.xml文件 --> <property name="mapperLocations" value="dao/*.xml"></property> </bean> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/> <property name="basePackage" value="dao" /> </bean> <tx:annotation-driven transaction-manager="transactionManager"/> <context:component-scan base-package="biz.impl"/> </beans> springmvc.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" 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/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <mvc:annotation-driven/><!-- 启动注解方式的mvc --> <context:component-scan base-package="action"/><!-- 扫描该包下所有类加载到容器 --> <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> <property name="prefix" value="/"/> <property name="suffix" value=".jsp"/> </bean> </beans>

eclipse运行web项目时服务器无法启动

这是一些错误提示 Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [conf/spring-mybatis.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [conf/spring-mybatis.xml]: Invocation of init method failed; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:331) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:107) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1410) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1151) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:299) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323) ... 46 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [conf/spring-mybatis.xml]: Invocation of init method failed; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1507) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:299) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323) ... 56 more Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:404) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:981) at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:628) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1014) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2255) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2286) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2085) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:795) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:44) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:404) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:400) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:327) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:148) at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:211) at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:142) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1377) at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1431) at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:632) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1635) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1574) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1503) ... 63 more Caused by: java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost. at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2957) at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:560) ... 89 more Related cause:

Eclipse中关于jsp页面引入js报404的问题

我觉得在页面上我是没有写错啥![图片说明](https://img-ask.csdn.net/upload/201606/20/1466393662_797201.png)是用maven创建的项目![](https://img-ask.csdn.net/upload/201606/20/1466393231_717929.png) 启动tomcat访问jsp页面的时候报404,看了一下图片上面,怎么变成乱码了![](https://img-ask.csdn.net/upload/201606/20/1466393324_282601.png) 我试了一下,用普通的web项目可以访问到js,但是用maven项目的话我的括号就会变成这个样子 我试了一下楼下的方法,把特![图片说明](https://img-ask.csdn.net/upload/201606/20/1466413771_801169.png)告诉我这不是真的。教教怎么给大括号转义啊。 坐等大虾搭救

eclipse启动java web出现404错误

启动tomcat之后,可以进入到localhost页面,但是后面再加 /项目名,就会出现404错误。进入不了想要运行的项目。这是什么情况,怎么解决,求救。。。

eclipse新建servlet总是404.

错误截图:![图片说明](https://img-ask.csdn.net/upload/201703/12/1489322409_296217.png) 我分别按照这两个链接的步骤所做,都是这个错误截图。 http://blog.csdn.net/love000520/article/details/52168381 与 http://jingyan.baidu.com/album/c843ea0b9aa91477931e4ac6.html?picindex=8 之前手动部署web.xml倒是成功了。

导入jsp项目进入eclipse中,没有错误,但是网页不弹出

从网上下载了一个jsp的项目,导入到了eclipse里面,jar和Tomcat都改了,而且也没有显示代码有问题。但是运行的时候,jsp网页就是不出来。但是我运行自己其他的jsp项目是可以运行的。这是为什么? ![图片说明](https://img-ask.csdn.net/upload/201711/12/1510452740_550003.png) 而且Tomcat一直处于这个状态 而在运行该程序时,也不像其他jsp那样可以弹出run on server的信息让你选择 求助!! ![图片说明](https://img-ask.csdn.net/upload/201711/12/1510452767_150938.png)

eclipse导入web项目出错问题?

项目的配置如下: ![图片说明](https://img-ask.csdn.net/upload/201708/03/1501729143_638076.png) ![图片说明](https://img-ask.csdn.net/upload/201708/03/1501729168_893566.png) eclipse的配置如下: ![图片说明](https://img-ask.csdn.net/upload/201708/03/1501729219_691576.png) ![图片说明](https://img-ask.csdn.net/upload/201708/03/1501729271_230488.png)

运行dynamic web project项目找不到webcontent下的jsp文件,报404错误?

运行dynamic web project项目找不到webcontent下的jsp文件 ![图片说明](https://img-ask.csdn.net/upload/201902/13/1550063123_252348.png) 这是目录,jsp文件是直接放在webcontent目录下的 运行项目后 ![图片说明](https://img-ask.csdn.net/upload/201902/13/1550063183_116963.png) 查了是路径问题,我把路径修改详细后能正常显示 ![图片说明](https://img-ask.csdn.net/upload/201902/13/1550063226_281754.png) 但请问各位大佬要怎么才能让他运行时就直接正确显示呢?找个很多资料都没找到解决方法,学习jsp中,请赐教,谢谢

求为什么myeclipse运行servlet出现404错误,但运行jsp时可以运行

求为什么myeclipse运行servlet出现404错误,但运行jsp时可以运行,是不是xml配置错误,xml怎样配置才是正确的,求帮忙

ssm项目报404错误,搭建后台管理系统的时候

controller ``` @RequestMapping("/admin/login") public String toAdminLogin(){ return "adminlogin"; } ``` ![jsp目录](https://img-ask.csdn.net/upload/201812/17/1545028044_196657.png) ![错误信息](https://img-ask.csdn.net/upload/201812/17/1545028250_96454.png) web.xml拦截/ ``` <servlet-mapping> <servlet-name>springmvc</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> ``` springmvc配置 ``` <mvc:annotation-driven/> <context:component-scan base-package="com.mq.controller"/> <mvc:default-servlet-handler/> <!-- 视图解析器 --> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="WEB-INF/jsp/" /> <property name="suffix" value=".jsp" /> </bean> <!-- 配置spring拦截器 --> <mvc:interceptors> <!-- 检查用户权限,对于部分不需要权限的路径进行排除 --> <mvc:interceptor> <!-- 先匹配所有路径,然后排除不需要检查的路径 --> <mvc:mapping path="/cart" /> <mvc:mapping path="/login"/> <mvc:mapping path="/wishlist"/> <!-- 与登录相关的请求 --> <mvc:exclude-mapping path="/"/> <mvc:exclude-mapping path="/i"/> <!-- <mvc:exclude-mapping path="/login" /> --> <mvc:exclude-mapping path="/register"/> <mvc:exclude-mapping path="/item"/> <mvc:exclude-mapping path="/userController"/> <mvc:exclude-mapping path="/search"/> <!-- 以下是静态资源 --> <mvc:exclude-mapping path="/img/**" /> <mvc:exclude-mapping path="/css/**" /> <mvc:exclude-mapping path="/bootstrap/**" /> <mvc:exclude-mapping path="/js/**" /> <!-- 用户是否已经登录的检查 --> <bean id="loginInterceptor" class="com.mq.interceptor.LoginInterceptor"></bean> </mvc:interceptor> </mvc:interceptors> ```

struts2在web.xml中添加支持后访问所有页面报404错误,什么原因?

struts2在web.xml中添加支持后访问所有页面报404错误,本地测试无任何问题,上传服务器就报所有页面404. ![图片说明](https://img-ask.csdn.net/upload/201511/27/1448593864_493029.png) web.xml ![图片说明](https://img-ask.csdn.net/upload/201511/27/1448593964_37024.png) struts.xml ![图片说明](https://img-ask.csdn.net/upload/201511/27/1448594035_586595.png) 运行后

eclipse运行导入的web工程时浏览器反馈500,Internal Server Error 详细情况如图

![图片说明](https://img-ask.csdn.net/upload/202003/09/1583733884_163876.png) 有人说是导入不正确,我反复导入了几遍都是这个问题,想请教一下大家

eclipse中运行java web项目时,一直显示修改之前的

修改完jsp和代码后运行,显示的还是修改之前的。 tomcat从新配置了,缓存也都清了(项目、tomcat、网页)work什么的也都删了; jsp也删了重新写了,也保存了。但是就是显示以前的

在eclipse中通过tomcat运行项目时报错,求解

# eclipse两个项目,一个项目可以通过tomcat正常运行,但另一个项目用tomcat运行就报错,求解 ![图片说明](https://img-ask.csdn.net/upload/201809/06/1536234525_607296.png) ## 报错的项目:一开始项目中有两个同名的Servlet文件放在不同的文件夹中,然后修改文件名后又把tomcat——>webapps文件夹里的临时文件删了,后再重启eclipse运行项目也会报错

eclipse+springmvc入门级项目myHelloWorld报404

helloWorld.jsp如下 <%@ page contentType="text/html; charset=GBK"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Spring输出HelloWorld</title> </head> <% String str=(String)request.getAttribute("helloWorld"); %> <body> <font> size='22'<%=str%>></font> </body> </html> dispatcherServlet-servlet如下 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/ dtd/spring-beans.dtd"> <beans> <!--定义映射--> <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="helloWorld.do">helloWorldController</prop> </props> </property> </bean> <!--定义视图--> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass"> <value>org.springframework.web.servlet.view.InternalResourceView</value> </property> </bean> <!--定义控制器--> <bean id="helloWorldController" class="com.myHelloWorld.action.HelloWorldController"> <property name="helloWorld"> <value>HelloWorld</value> </property> <property name="viewPage"> <value>/jsp/helloWorld.jsp</value> </property> </bean> </beans> web.xml如下 <?xml version="1.0" encoding="UTF-8"?> <web-app 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_4.xsd"> <servlet> <servlet-name>dispatcherServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <!--初始化参数--> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/dispatcherServlet-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <!--拦截所有以do结尾的请求--> <servlet-mapping> <servlet-name>dispatcherServlet</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> </web-app> HelloWorldController.java如下 //******* HelloWorldController.java************** package com.myHelloWorld.action; import java.io.IOException; import java.util.HashMap; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.Controller; //实现了Controller接口 public class HelloWorldController implements Controller { private String helloWorld; private String viewPage; //实现Controller接口中的handleRequest()方法 public ModelAndView handleRequest(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { Map model = new HashMap(); model.put("helloWorld", getHelloWorld()); return new ModelAndView(getViewPage(), model); } //依赖注入要返回的页面 public void setViewPage(String viewPage) { this.viewPage = viewPage; } //获取要返回的页面 public String getViewPage() { return viewPage; } //依赖注入显示在页面中的文字 public void setHelloWorld(String helloWorld) { this.helloWorld = helloWorld; } //获取要显示在页面中的文字 public String getHelloWorld() { return helloWorld; } } 本地运行http://localhost:8080/myHelloWorld/helloWorld.do报如下错误: HTTP Status 404 - /myHelloWorld/jsp/helloWorld.jsp type Status report message /myHelloWorld/jsp/helloWorld.jsp description The requested resource is not available. Apache Tomcat/7.0.55

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

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

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

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Intellij IDEA 实用插件安利

1. 前言从2020 年 JVM 生态报告解读 可以看出Intellij IDEA 目前已经稳坐 Java IDE 头把交椅。而且统计得出付费用户已经超过了八成(国外统计)。IDEA 的...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

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

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

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

魂迁光刻,梦绕芯片,中芯国际终获ASML大型光刻机

据羊城晚报报道,近日中芯国际从荷兰进口的一台大型光刻机,顺利通过深圳出口加工区场站两道闸口进入厂区,中芯国际发表公告称该光刻机并非此前盛传的EUV光刻机,主要用于企业复工复产后的生产线扩容。 我们知道EUV主要用于7nm及以下制程的芯片制造,光刻机作为集成电路制造中最关键的设备,对芯片制作工艺有着决定性的影响,被誉为“超精密制造技术皇冠上的明珠”,根据之前中芯国际的公报,目...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

差点跪了...

最近微信又搞出了一个大利器,甚至都上了热搜,当然消息最敏捷的自媒体人,纷纷都开通了自己的视频号。01 视频号是什么呢?视频号是微信体系内的短视频,它不同...

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

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

Vue回炉重造之router路由(更新中)

你好,我是Vam的金豆之路,可以叫我豆哥。2019年年度博客之星、技术领域博客专家。主要领域:前端开发。我的微信是 maomin9761,有什么疑问可以加我哦,自己创建了一个微信技术交流群,可以加我邀请你一起交流学习。最后自己也创建了一个微信公众号,里面的文章是我自己精挑细选的文章,主要介绍各种IT新技术。欢迎关注哦,微信搜索:臻美IT,等你来。 欢迎阅读本博文,本博文主要讲述【】,文字通...

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大胆预测下未来5年的Web开发

在2019年的ReactiveConf 上,《Elm in Action》的作者Richard Feldman对未来5年Web开发的发展做了预测,很有意思,分享给大家。如果你有机会从头...

立即提问
相关内容推荐