MyEclipse搭建SSH框架时,运行自动生成的index.jsp

MyEclipse搭建SSH框架时,运行自动生成的index.jsp,启动tomcat报如下错误,捣鼓了好久一直没有解决,望大神帮忙

4个回答

错误信息你不说一下怎么知道

错误信息你不说一下怎么知道

1.可能你Tomcat配置错误
2.你JDK没有配置好
3.配置文件里有错误
建议你检查者3点

发一下错误信息看看啊,不然怎么知道是什么错误

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
myEclipse搭建SSH框架,myclipse自动引入包之后,运行有错信息
搭建玩架构之后,运行错误信息如下: 严重: 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 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [mydateSource] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455) 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:3827) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) 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:497) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [mydateSource] at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:68) at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:116) at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:223) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:89) at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:71) at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2277) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2273) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1742) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1782) at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:189) at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:350) at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:335) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) ... 36 more Caused by: javax.naming.NameNotFoundException: Name mydateSource is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:770) at org.apache.naming.NamingContext.lookup(NamingContext.java:140) at org.apache.naming.SelectorContext.lookup(SelectorContext.java:121) at javax.naming.InitialContext.lookup(InitialContext.java:421) at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:65) ... 55 more ``` 求神看看,这是怎么回事。
ssh框架web,自动生成hbm.xml和实体类
ssh框架web,数据库由MySQL变oracle,myeclipse自动生成hbm.xml和实体类,Injection of resource dependencies failed。 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'BHZControl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bhzdataService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'baseDAO': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void com.xyu.dao.impl.BaseDAOImpl.setSessionFactory(org.hibernate.SessionFactory); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.cfg.annotations.reflection.XMLContext$Default.getDelimitedIdentifier()Ljava/lang
自动生成类似.tmp_index.jsp.4470~的文件
MyEclipse在修改jsp后,tomcat里的jsp文件夹下会生成类似.tmp_index.jsp.4470~ 的文件?为什么?怎么不生成 ![图片说明](https://img-ask.csdn.net/upload/201606/06/1465195361_298560.png)
myeclipse的ssh框架配置出错了
严重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:170) at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1006) at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:982) at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:934) at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:583) at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:116) at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4900) at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5537) at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:221) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:149) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1129) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1871) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
请问,关于SSH框架,myeclipse8.5如何添加 hibernate4?
请问,关于SSH框架,myeclipse8.5如何添加 hibernate4?
myeclipse配置ssh出错
![图片说明](https://img-ask.csdn.net/upload/201508/01/1438411783_590931.png) myeclipse 部署ssh出现这个错误 各路大婶求解
myeclipse2014下ssh框架 查询用户信息时出错
问题:myeclipse2014下ssh框架里用getHibernateTemplate().find()查询用户信息时出错(运行之后,输入用户名和密码,按登录,显示错误500) 下面是我的查询代码,因为没有真正的学习过,都是网上找的项目自己做,不清楚怎么解决 ``` import java.util.List; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; import com.model.User; public class LoginDAOImpl extends HibernateDaoSupport implements LoginDAO{ public boolean login(String username, String password) { List<User> user = this.getHibernateTemplate().find( "from User where uname=? and upassword=?", new String[] { username, password }); boolean flag = false; if (user.size() > 0) { flag = true; } return flag; } } ``` 这里是我反向工程得出的User类 ``` public class User extends AbstractUser implements java.io.Serializable { // Constructors /** default constructor */ public User() { } /** full constructor */ public User(Integer uid, String uname, String upassword) { super(uid, uname, upassword); } } ``` debug的时候执行到getHibernateTemplate().find()的时候就出了问题 下边是applicationContext.xml里的一些bean ``` <bean id="logind" class="com.dao.LoginDAOImpl"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <bean id="logins" class="com.service.LoginServiceImpl"> <property name="logindao" ref="logind" /> </bean> <bean id="loginAction" class="com.action.LoginAction" scope="prototype"> <property name="loginservice" ref="logins" /> </bean> ```
myeclipse在有jsp中自带的全局声明的时候,静态引入jsp的时候报错
在myeclipse里面新建一个工程后新建b.jsp和a.jsp放在工程的webroot目录下, 在b.jsp的<html>标签上面有jsp中自带的全局路径声明: ``` <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> ``` 在有jsp自带的全局路径声明的情况下,在<body>中静态引入jsp的时候就会报错, ``` <%@include file="a.jsp" %> ``` 错误信息如下: ``` Multiple annotations found at this line: - Duplicate local variable path - Duplicate local variable ``` 中文翻译如下: ``` 这一行有多个注释: -复制本地变量路径 -复制局部变量 ``` 可以确认file的相对路径是对的,因为a.jsp和b.jsp在同一个文件夹下。 另外在删掉jsp中自带的全局声明的时候下面的静态引入就不报错了。
在Myeclipse配置Struts,用tomcat测试一个index.jsp时出现问题
本人新手,求助各位大牛~~~~~ HTTP Status 500 - cn.it.shop.action.CategoryAction.1() -------------------------------------------------------------------------------- type Exception report message cn.it.shop.action.CategoryAction.1() description The server encountered an internal error that prevented it from fulfilling this request. exception java.lang.NoSuchMethodException: cn.it.shop.action.CategoryAction.1() java.lang.Class.getMethod(Class.java:1607) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:75) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:47) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:236) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:236) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:511) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) note The full stack trace of the root cause is available in the Apache Tomcat/6.0.44 logs. -------------------------------------------------------------------------------- Apache Tomcat/6.0.44 -------------------------------------------------------------------------------- 这是Struts.xml: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd"> <struts> <package name="shop" extends="struts-default"> <action name="category_*" class="cn.it.shop.action.CategoryAction" method="1"> <result name="index">/index.jsp</result> </action> </package> </struts> -------------------------------------------------------------------------------- 这是CategoryAction.java: package cn.it.shop.action; import cn.it.shop.service.CategoryService; import com.opensymphony.xwork2.ActionSupport; public class CategoryAction extends ActionSupport { private CategoryService categoryService; public void setCategoryService(CategoryService categoryService) { this.categoryService = categoryService; } public String update(){ System.out.println("----update----"); System.out.println(categoryService); return "index"; } public String save(){ System.out.println("----save----"); System.out.println(categoryService); return "index"; } } -------------------------------------------------------------------------------- 这是index.jsp <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>My JSP 'index.jsp' starting page</title> </head> <body> <a href="${pageContext.request.contextPath}/category_update.action">访问 update</a> <a href="category_save.action">访问 save</a> </body> </html> --------------------------------------------------------------------------------
SSH框架 论MyEclipse10 下ContextLoaderListener 出现的问题
# 论SSH框架搭建完成后运行出现ContextLoaderListener的问题 错误提示: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:516) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:566) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:117) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:328) ... 36 more 2015-6-30 22:51:56 org.apache.catalina.core.StandardContext start 严重: Error listenerStart 显然表明 ,是applicationContext.xml 没被读取,可能原因是路径问题。但我这是 SSH框架配置好的,所导入的包,所写的配置,都是按照标准弄得,applicationContext.xml 是放在WEB-INF目录下的,通常不手动配置的话是在WEB-INF/classes下的,显然,我经过了手动配置。 其次,监听也就是web.xml里的没配置保证是没问题的。不解!!!为何报错!! 还有,在applicationcontext.xml中,所手动写入的bean是没问题的。 最后 ,这个问题出的很奇怪,上午我运行的好好的,并未有任务异常,今天晚上再来运行,就出现了这个问题。郁闷中,运行了其他的项目试试,全出现了相同的问题,但我并未做任何的处理!! 推测 ,这不是项目中代码的问题,但仅仅只是推测。求解!这是为何??? 请求各位前辈们指点!!
SSH框架Hibernate基于Spring自动生成的DAO怎样使用
applicantContext.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:p="http://www.springframework.org/schema/p" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd" xmlns:tx="http://www.springframework.org/schema/tx"> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="configLocation" value="classpath:hibernate.cfg.xml"> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <tx:annotation-driven transaction-manager="transactionManager" /> <bean id="UserDAO" class="org.dao.UserDAO"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> </beans> ``` Hibernate.cfg.xml ``` <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <!-- Generated by MyEclipse Hibernate Tools. --> <hibernate-configuration> <session-factory> <property name="dialect"> org.hibernate.dialect.MySQLDialect </property> <property name="connection.url"> jdbc:mysql://localhost:3306/ </property> <property name="connection.username">root</property> <property name="connection.password">root</property> <property name="connection.driver_class"> com.mysql.jdbc.Driver </property> <property name="myeclipse.connection.profile">mysql</property> <property name="hibernate.hbm2ddl.auto">update</property> <property name="hibernate.show_sql">true</property> <property name="hibernate.format_sql">true</property> <property name="cache.use_query_cache">true</property> <property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property> <property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property> <property name="current_session_context_class">org.springframework.orm.hibernate4.SpringSessionContext</property> <mapping resource="org/vo/User.hbm.xml" /> </session-factory> </hibernate-configuration> ``` UserDAO类 ``` public class UserDAO { private static final Logger log = LoggerFactory.getLogger(UserDAO.class); // property constants public static final String UNAME = "uname"; public static final String PASSWORD = "password"; private SessionFactory sessionFactory; public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } private Session getCurrentSession() { return sessionFactory.getCurrentSession(); } protected void initDao() { // do nothing } public void save(User transientInstance) { log.debug("saving User instance"); try { getCurrentSession().save(transientInstance); log.debug("save successful"); } catch (RuntimeException re) { log.error("save failed", re); throw re; } } public void delete(User persistentInstance) { log.debug("deleting User instance"); try { getCurrentSession().delete(persistentInstance); log.debug("delete successful"); } catch (RuntimeException re) { log.error("delete failed", re); throw re; } } public User findById(java.lang.Integer id) { log.debug("getting User instance with id: " + id); try { User instance = (User) getCurrentSession().get("org.vo.User", id); return instance; } catch (RuntimeException re) { log.error("get failed", re); throw re; } } public List<?> findByExample(User instance) { log.debug("finding User instance by example"); try { List<?> results = getCurrentSession().createCriteria("org.vo.User") .add(Example.create(instance)).list(); log.debug("find by example successful, result size: " + results.size()); return results; } catch (RuntimeException re) { log.error("find by example failed", re); throw re; } } public List<?> findByProperty(String propertyName, Object value) { log.debug("finding User instance with property: " + propertyName + ", value: " + value); try { String queryString = "from User as model where model." + propertyName + "= ?"; Query queryObject = getCurrentSession().createQuery(queryString); queryObject.setParameter(0, value); return queryObject.list(); } catch (RuntimeException re) { log.error("find by property name failed", re); throw re; } } public List<?> findByUname(Object uname) { return findByProperty(UNAME, uname); } public List<?> findByPassword(Object password) { return findByProperty(PASSWORD, password); } public List<?> findAll() { log.debug("finding all User instances"); try { String queryString = "from User"; Query queryObject = getCurrentSession().createQuery(queryString); return queryObject.list(); } catch (RuntimeException re) { log.error("find all failed", re); throw re; } } public User merge(User detachedInstance) { log.debug("merging User instance"); try { User result = (User) getCurrentSession().merge(detachedInstance); log.debug("merge successful"); return result; } catch (RuntimeException re) { log.error("merge failed", re); throw re; } } public void attachDirty(User instance) { log.debug("attaching dirty User instance"); try { getCurrentSession().saveOrUpdate(instance); log.debug("attach successful"); } catch (RuntimeException re) { log.error("attach failed", re); throw re; } } public void attachClean(User instance) { log.debug("attaching clean User instance"); try { getCurrentSession().buildLockRequest(LockOptions.NONE).lock( instance); log.debug("attach successful"); } catch (RuntimeException re) { log.error("attach failed", re); throw re; } } public static UserDAO getFromApplicationContext(ApplicationContext ctx) { return (UserDAO) ctx.getBean("UserDAO"); } } ``` HibernateSessionFactory类 ``` public class HibernateSessionFactory { /** * Location of hibernate.cfg.xml file. * Location should be on the classpath as Hibernate uses * #resourceAsStream style lookup for its configuration file. * The default classpath location of the hibernate config file is * in the default package. Use #setConfigFile() to update * the location of the configuration file for the current session. */ private static final ThreadLocal<Session> threadLocal = new ThreadLocal<Session>(); private static org.hibernate.SessionFactory sessionFactory; private static Configuration configuration = new Configuration(); private static ServiceRegistry serviceRegistry; static { try { configuration.configure(); serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry(); sessionFactory = configuration.buildSessionFactory(serviceRegistry); } catch (Exception e) { System.err.println("%%%% Error Creating SessionFactory %%%%"); e.printStackTrace(); } } private HibernateSessionFactory() { } /** * Returns the ThreadLocal Session instance. Lazy initialize * the <code>SessionFactory</code> if needed. * * @return Session * @throws HibernateException */ public static Session getSession() throws HibernateException { Session session = (Session) threadLocal.get(); if (session == null || !session.isOpen()) { if (sessionFactory == null) { rebuildSessionFactory(); } session = (sessionFactory != null) ? sessionFactory.openSession() : null; threadLocal.set(session); } return session; } /** * Rebuild hibernate session factory * */ public static void rebuildSessionFactory() { try { configuration.configure(); serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry(); sessionFactory = configuration.buildSessionFactory(serviceRegistry); } catch (Exception e) { System.err.println("%%%% Error Creating SessionFactory %%%%"); e.printStackTrace(); } } /** * Close the single hibernate session instance. * * @throws HibernateException */ public static void closeSession() throws HibernateException { Session session = (Session) threadLocal.get(); threadLocal.set(null); if (session != null) { session.close(); } } /** * return session factory * */ public static org.hibernate.SessionFactory getSessionFactory() { return sessionFactory; } /** * return hibernate configuration * */ public static Configuration getConfiguration() { return configuration; } } ``` 测试类 ``` package org.action; import org.dao.UserDAO; import org.vo.User; public class Test { public static void main(String[] args) { // TODO Auto-generated method stub // Session session = HibernateSessionFactory.getSession(); // session.beginTransaction(); // 插入数据 // session.save(new User("大傻", "123")); // 通过id查询数据 // User user = (User) session.load(User.class, 1); // System.out.println(user.getPassword()); // 通过id查找并删除数据 // User user = (User) session.get(User.class, 8); // session.delete(user); // 通过id查找并修改数据 // User user = (User) session.load(User.class, 9); // user.setPassword("999999"); // session.saveOrUpdate(user); // UserDAO userDAO = new UserDAO(); User user = new User("Jone", "111111"); userDAO.save(user); // session.getTransaction().commit(); // session.close(); } } ``` * 错误提示 ``` SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. Exception in thread "main" java.lang.NullPointerException at org.dao.UserDAO.getCurrentSession(UserDAO.java:41) at org.dao.UserDAO.save(UserDAO.java:51) at org.action.Test.main(Test.java:40) ``` 第一行指向 ``` UserDAO的private Session getCurrentSession() { return sessionFactory.getCurrentSession(); } ``` 第二行错误指向 ``` public void save(User transientInstance) { log.debug("saving User instance"); try { # getCurrentSession().save(transientInstance); log.debug("save successful"); } catch (RuntimeException re) { log.error("save failed", re); throw re; } } ```
关于MyEclipse中Web新建项目运行后出现:404
各位大侠,本人刚学jsp,在自己的电脑上的MyEclipse里新建了个text项目,TOmcat运行没错,运行: http://localhost:8080正常出现界面,但是换成http://localhost:8080/text/index.jsp 就出现报错404,请各位大侠指教一下,谢谢!
myeclipse10.0安装会自动生成一个带空格的文件夹,汉化和使用会报错
汉化要求安装路径不能带有空格,但是安装时会自动生成一个myeclipse 10的文件夹,无法汉化,该怎么办? [图片说明](https://img-ask.csdn.net/upload/201507/24/1437705789_229608.png) 尝试过把空格去掉,但这样就无法启动程序会报错 ![图片说明](https://img-ask.csdn.net/upload/201507/24/1437705984_266438.png)
修改.project文件后打开myeclipse,生成.project.bank内容不一致
由于引入js文件,打开显示Missing semicolon,想去.project文件里删除验证js功能,可是再次打开myeclipse他居然会自动生成未修改的样子,真是头疼,哪位大神帮忙解决下!!
学习用MyEclipse 2013开发SSH项目遇到java.lang.NullPointerException问题,请帮助!
**SaveOfficeAction.java出错:java.lang.NullPointerException** package we.app.action; import we.app.data.*; import com.opensymphony.xwork2.ActionSupport; public class SaveOfficeAction extends ActionSupport { private IOffice B_Office; private IOfficeDAO B_OfficeDAO; private String Tips; public IOffice getB_Office() { return B_Office; } public void setB_Office(IOffice b_Office) { B_Office = b_Office; } public IOfficeDAO getB_OfficeDAO() { return B_OfficeDAO; } public void setB_OfficeDAO(IOfficeDAO b_OfficeDAO) { B_OfficeDAO = b_OfficeDAO; } public String getTips() { return Tips; } public void setTips(String tips) { Tips = tips; } public String execute() throws Exception { this.Tips=this.getB_OfficeDAO().findById(1).getOfficename().toString(); //this.Trans_OfficeDAO.save(this.B_Office); return SUCCESS; } } **1、index.jsp:** <%@taglib uri="/struts-tags" prefix="s"%><%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'index.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head> <body> <s:form action="SaveOffice"> <s:textfield name="B_Office.officename" label="officename"></s:textfield> <s:submit></s:submit> </s:form> <br> </body> </html> **2、hibernate.cfg.xml:** <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <!-- Generated by MyEclipse Hibernate Tools. --> <hibernate-configuration> <session-factory> <property name="dialect">org.hibernate.dialect.SQLServerDialect</property> <property name="connection.url"> jdbc:jtds:sqlserver://192.168.0.100:4628/tnew </property> <property name="connection.username">sa</property> <property name="connection.password">111</property> <property name="connection.driver_class"> net.sourceforge.jtds.jdbc.Driver </property> <property name="myeclipse.connection.profile"> sqlserverjtds </property> <mapping resource="we/app/data/Peop.hbm.xml" /> <mapping resource="we/app/data/Office.hbm.xml" /> </session-factory> </hibernate-configuration> 3、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:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd" > <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="configLocation" value="classpath:hibernate.cfg.xml"> </property> </bean> <bean id="PeopDAO" class="we.app.data.PeopDAO"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> <bean id="B_OfficeDAO" class="we.app.data.OfficeDAO"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> <bean id="B_Office" class="we.app.data.Office"></bean> <bean id="B_Peop" class="we.app.data.Peop"></bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory"> <ref bean="sessionFactory"/> </property> </bean> <bean id="Trans_OfficeDAO" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"> <ref bean="transactionManager" /> </property> <property name="target"> <ref local="B_OfficeDAO" /> </property> <property name="transactionAttributes"> <props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> </beans> 4、 package we.app.data; import java.util.List; public interface IOfficeDAO { // property constants public static final String OFFICENAME = "officename"; public abstract void save(IOffice transientInstance); public abstract void delete(IOffice persistentInstance); public abstract IOffice findById(java.lang.Integer id); public abstract List findByExample(IOffice instance); public abstract List findByProperty(String propertyName, Object value); public abstract List findByOfficename(Object officename); public abstract List findAll(); public abstract IOffice merge(Office detachedInstance); public abstract void attachDirty(IOffice instance); public abstract void attachClean(IOffice instance); }
关于myeclipse10 jsp的问题
type Status report message /HMapVis_0.2/userLogin.jsp description The requested resource (/HMapVis_0.2/userLogin.jsp) is not available. http://localhost/HMapVis_0.2/userLogin.jsp出现上述问题 但是输入http://localhost/HMapVis_0.2/index.jsp 可以出现页面,怎么解决,求大神告知
myeclipse. jsp. sqlsever
1.运行这个,报出这样的错误。 2. package com.Dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.List; import com.beans.Book; import com.tools.DBConnection; public class PageQueryDao { //分页查询所有书目信息 public List<Book> getPageList(int page){ List<Book> list = new ArrayList<Book>(); DBConnection DB = new DBConnection(); Connection conn=DB.getCon(); int m = (page-1)*Book.PAGE_SIZE; if( m > 0 || m == 0){ String sql = "select top 6 * from books where BookID > "+ m ; //String sql="select * from books order by BookID asc limit ?,?";//limit关键字 try { PreparedStatement pstm=conn.prepareStatement(sql); //pstm.setInt(1, (page-1)*Book.PAGE_SIZE); //设置查询记录的开始位置 //pstm.setInt(2, Book.PAGE_SIZE); //设置查询数据所返回的记录数 ResultSet rs = pstm.executeQuery(); while(rs.next()){ Book book=new Book(); book.setBookId(rs.getInt("BookID")); book.setName(rs.getString("Name")); book.setAuthor(rs.getString("Author")); book.setPublisher(rs.getString("Publisher")); book.setPrice(rs.getString("Price")); list.add(book); } rs.close(); pstm.close(); conn.close(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return list; } //查询总记录数 public int FindCounts(){ int count=0; DBConnection DB=new DBConnection(); Connection conn=DB.getCon(); String sql="select count(*) from books"; try { PreparedStatement pstm=conn.prepareStatement(sql); ResultSet rs=pstm.executeQuery(); if(rs.next()){//rs里就一个值 count=rs.getInt(1); } rs.close(); conn.close(); } catch (SQLException e){ // TODO Auto-generated catch block e.printStackTrace(); } return count; } /*public static void main(String[] args){ System.out.println((getPageList(0)).size() ); System.out.println((getPageList(1)).size() ); List<Book> list = getPageList(0); if(list != null){ for(Book b:list){ System.out.println(b.getBookId()); System.out.println(b.getName()); System.out.println(b.getPrice()); System.out.println(b.getPublisher()); System.out.println(b.getAuthor()); } } }*/ 3.<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%@page import="java.util.List"%><%@page import="com.beans.Book"%><html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> <head> <title>图书信息列表</title> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> <style type="text/css"> a:link{color:#FF4500;text-decoration:none}/*未访问,红色,无下划线*/ a:active{color:blue;}/*激活,红色*/ a:visited{color:red;text-decoration:none}/*已访问,紫色,无下划线*/ a:hover{color:yellow;text-decoration:underline}/*鼠标移动上面,蓝色,下划线*/ </style> </head> <body bgcolor="#98FB98" > <br><br> <table align="center" width="900"> <tr> <td align="center" colspan="6" valign="baseline"> <h2 style=" font-family:隶书;color:#0A0A0A;font-size:50px">喵喵网上书店</h2> </td> </tr> <%! int i=1,j=1; %> <% List<Book> list = request.getAttribute("list");%> <% for(j=1;j<=2;j++){ %> <tr > <% if(list != null){ for(Book b:list){ if(j==2){ if(b.getBookId()<=3||(b.getBookId()>=7&&b.getBookId()<=9)) continue; } %> <td width="100" height="140"><img src="images/<%=String.valueOf(b.getBookId()-1) %>.jpg"/></td> <td width="160"> <font color="#0000FF" face="隶书">ISDN :<%=b.getBookId() %></font><br> <font color="#0000FF" face="隶书"> 书 名:<%=b.getName() %></font><br> <font color="#0000FF" face="隶书"> 作 者:<%=b.getAuthor() %></font><br> <font color="#0000FF" face="隶书">出 版:<%=b.getPublisher() %></font><br> <font color="#0000FF" face="隶书">价 格:<%=b.getPrice() %> </font><br>    <a href="BookInfo/<%=b.getBookId()%>.jsp?bookid=<%=b.getBookId()%>">查看详细信息</a> </td> <% if(b.getBookId()%3==0) break; %> <%} %> </tr> <%} }%> <tr> <td align="right" colspan="6"><%= request.getAttribute("bar") %> </td> </tr> </table> </body> </html> 4.package com.servlets;import java.io.IOException;import java.util.List;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import com.Dao.PageQueryDao;import com.beans.Book;public class PageQueryServlet extends HttpServlet { /** * */ private static final long serialVersionUID = 1L; public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException { int currpage=1; // if(request.getParameter("page") != null){ // currpage = Integer.parseInt(request.getParameter("page")); // } PageQueryDao pagedao = new PageQueryDao(); List<Book> list = pagedao.getPageList(currpage);//查询当前页记录 request.setAttribute("list", list); int pages; //计算查询总页数 int count = pagedao.FindCounts(); if(count%Book.PAGE_SIZE == 0){ pages = count/Book.PAGE_SIZE; } else{ pages = count/Book.PAGE_SIZE+1; } System.out.println(pages); StringBuffer sb=new StringBuffer(); //构建分页条 for(int i = 1;i <= pages;i++){ if(i == currpage){ sb.append("『" + i + "』"); } else{ sb.append("<a href='PageQueryServlet ? page = "+i+"'> 下一页 </a>"); } sb.append(" "); } request.setAttribute("bar", sb.toString()); request.getRequestDispatcher("books.jsp").forward(request, response); //请求转发 } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); }} 就是这几个文件,数据库能成功连接。PageDao中的主函数能成功运行。就是jsp中无法获取list中的信息。PageServlet无法运行显示出books.jsp界面的相关信息。 希望大神们赐教。![图片](https://img-ask.csdn.net/upload/201612/19/1482138587_699459.png)
新手求助!在MyEclipse导入Struts框架搭建的项目出现404错误!
HTTP Status 404 - /16/WebRoot/admin_index.jsp -------------------------------------------------------------------------------- type Status report message /16/WebRoot/admin_index.jsp description The requested resource is not available. -------------------------------------------------------------------------------- Apache Tomcat/7.0.63 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="wyLogistics" extends="struts-default"> <action name="admin_*" class="com.webtier.AdminAction" method="{1}"> <result name="success">/admin_{1}.jsp</result> <result name="input">/admin_{1}.jsp</result> </action> <action name="car_*" class="com.webtier.CarAction" method="{1}"> <result name="success">/car_{1}.jsp</result> <result name="input">/car_{1}.jsp</result> <result name="operationSuccess" type="redirect">car_queryCarList.action</result> </action> <action name="customer_*" class="com.webtier.CustomerAction" method="{1}"> <result name="success">/customer_{1}.jsp</result> <result name="input">customer_queryCustomerList.action</result> <result name="operationSuccess1" type="redirect">customer_queryCustomerList.action</result> </action> <action name="goods_*" class="com.webtier.GoodsAction" method="{1}"> <result name="success">/goods_{1}.jsp</result> <result name="deleteSuccess" type="redirect">goods_queryGoodsList.action</result> </action> </package> </struts> 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"> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> 一部分AdminAction的代码: public class AdminAction extends AdminForm { private static AdminDao adminDao = null; static{ adminDao=new AdminDao(); } // 对登录用户的表单验证是否为空 public void validateIndex() { if (null == admin_user || admin_user.equals("")) { this.addFieldError("admin_user", "| 请您输入用户名"); } if (null == admin_password || admin_password.equals("")) { this.addFieldError("admin_password", "| 请您输入密码"); } } // 对登录用户的表单验证 public String index() { String query_password = adminDao.getAdminPassword(admin_user); if (query_password.equals("")) { this.addActionError("| 该用户名不存在"); return INPUT; } if (!query_password.equals(admin_password)) { this.addActionError("| 您输入的密码有误,请重新输入"); return INPUT; } session.put("admin_user", admin_user); return SUCCESS; } // 对修改管理员密码表单验证是否为空 public void validateUpdatePassword() { if (null == admin_password || admin_password.equals("")) { this.addFieldError("admin_password", "请输入原密码"); } if (null == admin_repassword1 || admin_repassword1.equals("")) { this.addFieldError("admin_repassword1", "请输入新密码"); } if (null == admin_repassword2 || admin_repassword2.equals("")) { this.addFieldError("admin_repassword2", "请输入密码确认"); } if (!admin_repassword1.equals(admin_repassword2)) { this.addActionError("您输入两次密码不相同,请重新输入!!!"); } } public String updatePassword() { String query_password = adminDao.getAdminPassword(admin_user); if (!admin_password.equals(query_password)) { this.addFieldError("admin_password", "您输入的原密码有误,请重新输入"); } String sql = "update tb_admin set admin_password='" + admin_repassword1 + "' where admin_user='" + admin_user + "'"; if (!adminDao.operationAdmin(sql)) { this.addActionError("修改密码失败!!!"); return INPUT; } else { request.setAttribute("editPassword", "您修改密码成功,请您重新登录!!!"); return SUCCESS; } } } 第一次提问,希望大神们多多指教!小弟也会虚心受教。
求为什么myeclipse运行servlet出现404错误,但运行jsp时可以运行
求为什么myeclipse运行servlet出现404错误,但运行jsp时可以运行,是不是xml配置错误,xml怎样配置才是正确的,求帮忙
130 个相见恨晚的超实用网站,一次性分享出来
相见恨晚的超实用网站 持续更新中。。。
我花了一夜用数据结构给女朋友写个H5走迷宫游戏
起因 又到深夜了,我按照以往在csdn和公众号写着数据结构!这占用了我大量的时间!我的超越妹妹严重缺乏陪伴而 怨气满满! 而女朋友时常埋怨,认为数据结构这么抽象难懂的东西没啥作用,常会问道:天天写这玩意,有啥作用。而我答道:能干事情多了,比如写个迷宫小游戏啥的! 当我码完字准备睡觉时:写不好别睡觉! 分析 如果用数据结构与算法造出东西来呢? ...
字节跳动视频编解码面经
三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时想着能进去就不错了,管他哪个岗呢,就同意了面试...
win10系统安装教程(U盘PE+UEFI安装)
一、准备工作 u盘,电脑一台,win10原版镜像(msdn官网) 二、下载wepe工具箱 极力推荐微pe(微pe官方下载) 下载64位的win10 pe,使用工具箱制作启动U盘打开软件, 选择安装到U盘(按照操作无需更改) 三、重启进入pe系统 1、关机后,将U盘插入电脑 2、按下电源后,按住F12进入启动项选择(技嘉主板是F12) 选择需要启...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、PDF搜索网站推荐 对于大部
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
此博客仅为我业余记录文章所用,发布到此,仅供网友阅读参考,如有侵权,请通知我,我会删掉。 补充 有不少读者留言说本文章没有用,因为天气预报直接打开手机就可以收到了,为何要多此一举发送到邮箱呢!!!那我在这里只能说:因为你没用,所以你没用!!! 这里主要介绍的是思路,不是天气预报!不是天气预报!!不是天气预报!!!天气预报只是用于举例。请各位不要再刚了!!! 下面是我会用到的两个场景: 每日下
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
Linux(服务器编程):15---两种高效的事件处理模式(reactor模式、proactor模式)
前言 同步I/O模型通常用于实现Reactor模式 异步I/O模型则用于实现Proactor模式 最后我们会使用同步I/O方式模拟出Proactor模式 一、Reactor模式 Reactor模式特点 它要求主线程(I/O处理单元)只负责监听文件描述符上是否有事件发生,有的话就立即将时间通知工作线程(逻辑单元)。除此之外,主线程不做任何其他实质性的工作 读写数据,接受新的连接,以及处...
HAL 硬件抽象层介绍
和你一起终身学习,这里是程序员Android本篇文章主要介绍Android开发中的部分知识点,通过阅读本篇文章,您将收获以下内容:和你一起终身学习,这里是程序员 Android本篇文章主要介绍Android开发中的部分知识点,通过阅读本篇文章,您将收获以下内容:一、HAL 概述一、HAL 概述HAL定义了供硬件供应商实施的标准接口,该接口使Android无需考虑底层驱动程序的实现。使用HA...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
      11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的 回答 - Bravo Yeung,获得该问题下回答中得最高赞(236赞和1枚专业勋章),对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalk
致 Python 初学者们!
作者 | 许向武 责编 | 屠敏 出品 | CSDN 博客 前言 在 Python 进阶的过程中,相信很多同学应该大致上学习了很多 Python 的基础知识,也正在努力成长。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 Python 这门编程语言,从2009年开始单一使用 Python 应对所有的开发工作,直至今
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观...
使用 Angular 打造微前端架构的 ToB 企业级应用
这篇文章其实已经准备了11个月了,因为虽然我们年初就开始使用 Angular 的微前端架构,但是产品一直没有正式发布,无法通过生产环境实践验证可行性,11月16日我们的产品正式灰度发布,所以是时候分享一下我们在使用 Angular 微前端这条路上的心得(踩过的坑)了额,希望和 Angular 社区一起成长一起进步,如果你对微前端有一定的了解并且已经在项目中尝试了可以忽略前面的章节。 什么是微前...
大学四年因为知道了这32个网站,我成了别人眼中的大神!
依稀记得,毕业那天,我们导员发给我毕业证的时候对我说“你可是咱们系的风云人物啊”,哎呀,别提当时多开心啦????,嗯,我们导员是所有导员中最帅的一个,真的???? 不过,导员说的是实话,很多人都叫我大神的,为啥,因为我知道这32个网站啊,你说强不强????,这次是绝对的干货,看好啦,走起来! PS:每个网站都是学计算机混互联网必须知道的,真的牛杯,我就不过多介绍了,大家自行探索,觉得没用的,尽管留言吐槽吧???? 社...
拿下微软、Google、Adobe,印度为何盛产科技圈 CEO?
作者 | 胡巍巍 出品 | CSDN(ID:CSDNnews) 世界500强中,30%的掌舵人,都是印度人。 是的,你没看错。这是近日《哈佛商业评论》的研究结果。 其中又以微软CEO萨提亚·纳德拉(Satya Nadella)、和谷歌CEO桑达尔·皮查伊(Sundar Pichai,以下简称劈柴)最为出名。 微软CEO萨提亚·纳德拉(Satya Nadella) 其他著名印度...
Linux(内核剖析):19---中断总体概述
一、为什么要引入中断? 任何操作系统内核的核心任务,都包含有对连接到计算机上的硬件设备进行有效管理,如硬盘、蓝光碟机、键盘、鼠标、3D 处理器,以及无线电等。而想要管理这些设备,首先要能和它们互通音信才行。众所周知,处理器的速度跟外围硬件设备的速度往往不在一个数量级上,因此,如果内核采取让处理器向硬件发出一个请求,然后专门等待回应的办法,显然差强人意。既然硬件的响应这么慢,那么内核就应该在此期间...
程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca...
深度学习笔记------卷积神经网络
深度学习笔记------卷积神经网络
一文带你入门Linux
文章目录1.1 Linux的概述:1.1.1 什么是Linux:1.1.1.1 学习Linux之前先了解Unix1.1.1.2 Linux的概述:1.1.1.3 Linux的历史:1.1.1.4 Linux系统的应用:1.1.1.5 Linux的版本1.1.1.6 Linux的主流版本1.2 Linux的安装:1.2.1 虚拟机安装:1.2.1.1 什么是虚拟机1.2.1.2 安装VmWare1....
普通三本毕业,我怎么一路艰辛进入阿里的
英雄不问出处? 自古以来就有这样一句话,真的英雄不问出处吗?这句话太挫了。普通三本院校的我,大四的时候居然都不知道什么是校招,所以出处太重要了。这也是没有机会参加阿里校招的原因,毕竟校招门槛比社招还是要低的,最重要的是校招进入阿里能让你的起点比别人更高。 有幸可以社招进入阿里,了解了校招的思路,赶紧介绍给学弟们,现在我们三本院校的小学弟今年居然有 3 个人通过了阿里的校招。下面我也把这份宝贵的经...
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东...
破14亿,Python分析我国存在哪些人口危机!
一、背景 二、爬取数据 三、数据分析 1、总人口 2、男女人口比例 3、人口城镇化 4、人口增长率 5、人口老化(抚养比) 6、各省人口 7、世界人口 四、遇到的问题 遇到的问题 1、数据分页,需要获取从1949-2018年数据,观察到有近20年参数:LAST20,由此推测获取近70年的参数可设置为:LAST70 2、2019年数据没有放上去,可以手动添加上去 3、将数据进行 行列转换 4、列名...
强烈推荐10本程序员在家读的书
很遗憾,这个春节注定是刻骨铭心的,新型冠状病毒让每个人的神经都是紧绷的。那些处在武汉的白衣天使们,尤其值得我们的尊敬。而我们这些窝在家里的程序员,能不外出就不外出,就是对社会做出的最大的贡献。 有些读者私下问我,窝了几天,有点颓丧,能否推荐几本书在家里看看。我花了一天的时间,挑选了 10 本我最喜欢的书,你可以挑选感兴趣的来读一读。读书不仅可以平复恐惧的压力,还可以对未来充满希望,毕竟苦难终将会...
Python实战:抓肺炎疫情实时数据,画2019-nCoV疫情地图
今天,群里白垩老师问如何用python画武汉肺炎疫情地图。白垩老师是研究海洋生态与地球生物的学者,国家重点实验室成员,于不惑之年学习python,实为我等学习楷模。先前我并没有关注武汉肺炎的具体数据,也没有画过类似的数据分布图。于是就拿了两个小时,专门研究了一下,遂成此文。
疫情数据接口api
返回json示例 { "errcode":0,//0标识接口正常 "data":{ "date":"2020-01-30 07:47:23",//实时更新时间 "diagnosed":7736,//确诊人数 "suspect":12167,//疑是病例人数 "death":170,//死亡人数 "cur...
智力题(程序员面试经典)
NO.1  有20瓶药丸,其中19瓶装有1克/粒的药丸,余下一瓶装有1.1克/粒的药丸。给你一台称重精准的天平,怎么找出比较重的那瓶药丸?天平只能用一次。 解法 有时候,严格的限制条件有可能反倒是解题的线索。在这个问题中,限制条件是天平只能用一次。 因为天平只能用一次,我们也得以知道一个有趣的事实:一次必须同时称很多药丸,其实更准确地说,是必须从19瓶拿出药丸进行称重。否则,如果跳过两瓶或更多瓶药...
疫情防控,开发者集结出战!
作者 | 屠敏出品 | CSDN(ID:CSDNnews)2020 年伊始,病毒肆虐,人心惶惶。截止北京时间 1 月 31 日 15 时 30 分,全国确诊新型冠状病毒肺炎的数字已达到了...
相关热词 c# 为空 判断 委托 c#记事本颜色 c# 系统默认声音 js中调用c#方法参数 c#引入dll文件报错 c#根据名称实例化 c#从邮件服务器获取邮件 c# 保存文件夹 c#代码打包引用 c# 压缩效率
立即提问