tomcat 找不到javaBean
最近学习jsp,学习javaBean,但是遇到tomcat找不到javaBean文件的.class文件,我按照网上说的包它打包并放在了WEB-INF/classes文件夹下了,不过不管怎么样,就是说找不到javaBean类,后来一气之下我把class文件打包成jar文件,放在了tomcat安装目录下的lib文件夹下,结果能运行。不知道这样的方法有没有什么不妥之处,还望大侠指点!
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used
一、控制台打印信息 "D:\Program Files\tomcat9.0.20\bin\catalina.bat" run [2019-10-26 08:59:45,240] Artifact Jia01.02:war exploded: Waiting for server connection to start artifact deployment... Using CATALINA_BASE: "C:\Users\Administrator\.IntelliJIdea2018.2\system\tomcat\Unnamed_ekp" Using CATALINA_HOME: "D:\Program Files\tomcat9.0.20" Using CATALINA_TMPDIR: "D:\Program Files\tomcat9.0.20\temp" Using JRE_HOME: "D:\Program Files\Java\jdk1.8.0_181" Using CLASSPATH: "D:\Program Files\tomcat9.0.20\bin\bootstrap.jar;D:\Program Files\tomcat9.0.20\bin\tomcat-juli.jar" Connected to the target VM, address: '127.0.0.1:65083', transport: 'socket' 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server.服务器版本: Apache Tomcat/9.0.20 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server.构建: May 3 2019 22:26:00 UTC 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.20.0 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Windows 10 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS.版本: 10.0 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log 结.造: amd64 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java 环境变量: D:\Program Files\Java\jdk1.8.0_181\jre 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM 版本: 1.8.0_181-b13 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM.供应商: Oracle Corporation 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: C:\Users\Administrator\.IntelliJIdea2018.2\system\tomcat\Unnamed_ekp 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: D:\Program Files\tomcat9.0.20 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\Administrator\.IntelliJIdea2018.2\system\tomcat\Unnamed_ekp\conf\logging.properties 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:65083,suspend=y,server=n 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -javaagent:C:\Users\Administrator\.IntelliJIdea2018.2\system\captureAgent\debugger-agent.jar=file:/C:/Users/Administrator/AppData/Local/Temp/capture11347.props 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote= 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms1024m 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx3072m 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:PermSize=256M 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:MaxPermSize=512M 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmn256M 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Duser.timezone=Asia/Shanghai 26-Oct-2019 08:59:46.571 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.net.preferIPv4Stack=true 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms1024m 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx3072m 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:PermSize=256M 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:MaxPermSize=512M 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmn256M 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Duser.timezone=Asia/Shanghai 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.net.preferIPv4Stack=true 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs= 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\Administrator\.IntelliJIdea2018.2\system\tomcat\Unnamed_ekp 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=D:\Program Files\tomcat9.0.20 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=D:\Program Files\tomcat9.0.20\temp 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.21] using APR version [1.6.5]. 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] 26-Oct-2019 08:59:46.587 信息 [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1a 20 Nov 2018] 26-Oct-2019 08:59:46.962 信息 [main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器 ["http-nio-8080"] 26-Oct-2019 08:59:46.993 信息 [main] org.apache.coyote.AbstractProtocol.init 初始化协议处理器 ["ajp-nio-8009"] 26-Oct-2019 08:59:46.993 信息 [main] org.apache.catalina.startup.Catalina.load 服务器在[827]毫秒内初始化 26-Oct-2019 08:59:47.056 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina] 26-Oct-2019 08:59:47.056 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.20] 26-Oct-2019 08:59:47.071 信息 [main] org.apache.coyote.AbstractProtocol.start 开始协议处理句柄["http-nio-8080"] 26-Oct-2019 08:59:47.103 信息 [main] org.apache.coyote.AbstractProtocol.start 开始协议处理句柄["ajp-nio-8009"] 26-Oct-2019 08:59:47.103 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in [103] milliseconds Connected to server [2019-10-26 08:59:47,353] Artifact Jia01.02:war exploded: Artifact is being deployed, please wait... 26-Oct-2019 08:59:57.450 信息 [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory 把web 应用程序部署到目录 [D:\Program Files\tomcat9.0.20\webapps\manager] 26-Oct-2019 08:59:58.502 信息 [Catalina-utility-1] org.apache.jasper.servlet.TldScanner.scanJars 至少有一个JAR被扫描用于TLD但尚未包含TLD。 为此记录器启用调试日志记录,以获取已扫描但未在其中找到TLD的完整JAR列表。 在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间。 26-Oct-2019 08:59:58.645 信息 [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [D:\Program Files\tomcat9.0.20\webapps\manager] has finished in [1,196] ms 26-Oct-2019 09:00:18.849 信息 [RMI TCP Connection(3)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars 至少有一个JAR被扫描用于TLD但尚未包含TLD。 为此记录器启用调试日志记录,以获取已扫描但未在其中找到TLD的完整JAR列表。 在扫描期间跳过不需要的JAR可以缩短启动时间和JSP编译时间。 本地网络IP:192.168.58.1,网卡物理地址:00:50:56:c0:00:08 2019-10-26 09:00:20,447 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: com.landray.kmss.framework.plugin.loader.PluginContextLoaderListener.printHwadd(159) 获取本地网卡地址时,出现多个网卡,可能会导致正式版的license失效,建议通过JVM参数“-Djgroups.bind_addr=ip地址”,绑定本机地址 授权给:深圳市蓝凌软件股份有限公司开发演示许可 试用版:2019-11-09 Plugin Context is starting ... WebContentPath:/E:/idea_workSpace/jointsoon/20191025_ekp_v15/out/artifacts/Jia01.02.war 2019-10-26 09:01:13,491 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(133) No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/E:/idea_workSpace/jointsoon/20191025_ekp_v15/out/artifacts/Jia01.02.war/WEB-INF/lib/ehcache-1.5.0.jar!/ehcache-failsafe.xml 2019-10-26 09:01:26,540 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: com.landray.kmss.sys.config.loader.KmssLookupListableBeanFactory.resolveBeanDefinition(151) Overriding bean definition for bean 'lbpmRobotNodeServiceAdapter for using @replace': replacing [bean name: lbpmRobotNodeServiceAdapter; defined in ServletContext resource [/WEB-INF/KmssConfig/sys/lbpmservice/node/robotnode/spring.xml]] with [bean name: @replace(lbpmRobotNodeServiceAdapter); defined in ServletContext resource [/WEB-INF/KmssConfig/sys/workflow/support/oa/spring.xml]] 2019-10-26 09:01:36,793 [INFO] ==== RMI TCP Connection(3)-127.0.0.1: com.alibaba.druid.pool.DruidDataSource.init(722) {dataSource-1} inited 2019-10-26 09:02:13,638 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: com.landray.kmss.sys.restservice.client.cloud.eureka.EkpCloudClientFactoryBean.getObject(78) UnusableRestClient will be created, it will throw RestClientException when invoked at any time. 2019-10-26 09:02:36,036 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: com.landray.kmss.sys.authentication.integration.KmssProcessingFilterProxy.init(126) com.landray.kmss.sys.authentication.integration.KmssAuthenticationProcessingFilter is a GenericFilterBean, cannot execute init with a null value, be sure this situation is accepted. 2019-10-26 09:02:36,233 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.security.web.access.intercept.FilterSecurityInterceptor.afterPropertiesSet(141) Could not validate configuration attributes as the SecurityMetadataSource did not return any attributes from getAllConfigAttributes() 2019-10-26 09:02:36,713 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(133) No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/E:/idea_workSpace/jointsoon/20191025_ekp_v15/out/artifacts/Jia01.02.war/WEB-INF/lib/ehcache-1.5.0.jar!/ehcache-failsafe.xml 2019-10-26 09:02:36,726 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: net.sf.ehcache.CacheManager.detectAndFixDiskStorePathConflict(322) Creating a new instance of CacheManager using the diskStorePath "D:\Program Files\tomcat9.0.20\temp" which is already used by an existing CacheManager. The source of the configuration was classpath. The diskStore path for this CacheManager will be set to D:\Program Files\tomcat9.0.20\temp\ehcache_auto_created_1572051756726. To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache.xml) for each CacheManager instance. 2019-10-26 09:03:02,518 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(133) No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/E:/idea_workSpace/jointsoon/20191025_ekp_v15/out/artifacts/Jia01.02.war/WEB-INF/lib/ehcache-1.5.0.jar!/ehcache-failsafe.xml 2019-10-26 09:03:02,527 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: net.sf.ehcache.CacheManager.detectAndFixDiskStorePathConflict(322) Creating a new instance of CacheManager using the diskStorePath "D:\Program Files\tomcat9.0.20\temp" which is already used by an existing CacheManager. The source of the configuration was classpath. The diskStore path for this CacheManager will be set to D:\Program Files\tomcat9.0.20\temp\ehcache_auto_created_1572051782527. To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache.xml) for each CacheManager instance. 2019-10-26 09:03:02,535 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: com.landray.kmss.third.ftsearch.cache.ehcache.EhCacheProvider.buildCache(94) Could not find configuration [indexSchemaCache]; using defaults. 2019-10-26 09:03:03,176 [INFO] ==== RMI TCP Connection(3)-127.0.0.1: net.paoding.analysis.knife.PaodingMaker.getProperties(138) config paoding analysis from: D:\Program Files\tomcat9.0.20\bin\file:\E:\idea_workSpace\jointsoon\20191025_ekp_v15\out\artifacts\Jia01.02.war\WEB-INF\lib\paoding-landray.jar!\paoding-analysis.properties;D:\Program Files\tomcat9.0.20\bin\file:\E:\idea_workSpace\jointsoon\20191025_ekp_v15\out\artifacts\Jia01.02.war\WEB-INF\lib\paoding-landray.jar!\paoding-analysis-default.properties;D:\Program Files\tomcat9.0.20\bin\file:\E:\idea_workSpace\jointsoon\20191025_ekp_v15\out\artifacts\Jia01.02.war\WEB-INF\lib\paoding-landray.jar!\paoding-analyzer.properties;D:\Program Files\tomcat9.0.20\bin\file:\E:\idea_workSpace\jointsoon\20191025_ekp_v15\out\artifacts\Jia01.02.war\WEB-INF\lib\paoding-landray.jar!\paoding-dic-home.properties;E:\idea_workSpace\jointsoon\20191025_ekp_v15\out\artifacts\Jia01.02.war\WEB-INF\dic\paoding-dic-names.properties;D:\Program Files\tomcat9.0.20\bin\file:\E:\idea_workSpace\jointsoon\20191025_ekp_v15\out\artifacts\Jia01.02.war\WEB-INF\lib\paoding-landray.jar!\paoding-knives.properties;D:\Program Files\tomcat9.0.20\bin\file:\E:\idea_workSpace\jointsoon\20191025_ekp_v15\out\artifacts\Jia01.02.war\WEB-INF\lib\paoding-landray.jar!\paoding-knives-user.properties 2019-10-26 09:03:03,185 [INFO] ==== RMI TCP Connection(3)-127.0.0.1: net.paoding.analysis.knife.PaodingMaker.createPaodingWithKnives(456) add knike: net.paoding.analysis.knife.CJKKnife 2019-10-26 09:03:03,190 [INFO] ==== RMI TCP Connection(3)-127.0.0.1: net.paoding.analysis.knife.PaodingMaker.createPaodingWithKnives(456) add knike: net.paoding.analysis.knife.LetterKnife 2019-10-26 09:03:03,193 [INFO] ==== RMI TCP Connection(3)-127.0.0.1: net.paoding.analysis.knife.PaodingMaker.createPaodingWithKnives(456) add knike: net.paoding.analysis.knife.NumberKnife 2019-10-26 09:03:08,969 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:09,044 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:09,124 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:09,312 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:09,409 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:09,515 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:09,615 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:09,721 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:09,925 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:10,015 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:10,104 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:10,210 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:10,315 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:10,399 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:10,529 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:10,664 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:10,753 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:10,956 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:11,045 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:11,142 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:11,252 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:11,317 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:11,377 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:11,451 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:11,559 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:11,638 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:11,724 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:11,885 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:11,976 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:12,047 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:12,128 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:12,228 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:12,298 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:12,386 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:12,467 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 2019-10-26 09:03:12,542 [WARN] ==== RMI TCP Connection(3)-127.0.0.1: org.springframework.beans.GenericTypeAwarePropertyDescriptor.getWriteMethodForActualAccess(123) Invalid JavaBean property 'forwards' being accessed! Ambiguous write methods found next to actually used [public abstract void com.landray.kmss.common.actions.IStrutsActionSupport.setForwards(java.util.Map)]: [public final void com.landray.kmss.common.actions.AbstractActionController.setForwards(java.util.Map)] 二、一直在控制台打印这个,非常影响时间,怎么解决?
求MySQL练习题目的网站或者书
野生猿</br> ==========割=============</br> 最近公司内部转岗到java,做了一个数据统计的需求,MySql数据库9千多条数据我封装成JavaBean,一个个if到各部门,然后再for统计性别,人员,学历学位数量...被自己蠢哭了</br> 网上的mysql习题太散乱了,跪求那种一步步进阶的mysql习题书籍或者网站,我数据库一般般,连having执行是在where之前也是做这个需求翻博客才知道...路过的大神求指点 </br>==================================</br> 顺带一问,这个需求是统计部门下的部门人数,性别,学历学位</br> 具体是形成这样子的一个格式在web显示</br> 部门,下级部门数,人数,男性数,女性数....</br> 有两个表,一个是部门表,一个是员工信息表</br> 我用join把两个表连起来作为临时表再通过group by 和 count 去统计数量,因为每个员工的部门有直管部门,中间部门使用了DISTINCT去重统计 各位大神有没有什么其他思路,mysql语句好长,不知道会不会影响性能...
java.lang.NoSuchMethodError找不到方法,但是那个方法明明存在
错误信息如下: [code="java"]ERROR 2012-08-15 11:35:12,734 [com.opensymphony.webwork.dispatcher.ServletDispatcher] - Could not execute action java.lang.reflect.InvocationTargetException 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:592) at com.opensymphony.xwork.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:300) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:166) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164) at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164) at com.yzwb.cctv.logic.SignonInterceptor.intercept(SignonInterceptor.java:327) at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:164) at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116) at com.opensymphony.webwork.dispatcher.ServletDispatcher.serviceAction(ServletDispatcher.java:272) at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:237) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:172) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:233) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564) at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:594) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149) at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:490) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:211) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:805) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:696) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677) at java.lang.Thread.run(Thread.java:595) Caused by: java.lang.NoSuchMethodError: com/yzwb/cctv/domain/CivilContract.getContractAmount()D at com.yzwb.cctv.web.contract.archive.ArchiveContractQueryAction.queryCivilContract(ArchiveContractQueryAction.java:173) at com.yzwb.cctv.web.contract.archive.ArchiveContractQueryAction.doQuery(ArchiveContractQueryAction.java:78) ... 48 more[/code] 我想问一下下面这个Caused by: java.lang.NoSuchMethodError:******D这句话中最后的D是什么意思,以及这个错误为什么会发生。下面贴错误提示中涉及到的代码 1.JavaBean中的代码,证明那个方法时存在的 [code="java"] private long contractAmount; // 合同金额 public long getContractAmount() { return contractAmount; } public void setContractAmount(Long contractAmount) { if(contractAmount != null) this.contractAmount = contractAmount; else this.contractAmount = 0; } [/code] 2.调用这个方法并报错的那几行代码 [code="java"] double count = 0; for(Object o : paginationSupport.getItems()){ CivilContract con = (CivilContract)o; if(con.getContractAmount() != 0){//报错的位置在这行 count += con.getContractAmount(); } } [/code] 谢谢各位!
JSP,mysql,tomcat,罕见中文乱码问题from textarea?
最近在上手学javaweb,根据书里的练习题要做一个雇员系统,其中有一项是用textarea输入雇员的简介,大概就是一个页面输入信息,然后通过submit传值到另一个页面用javabean 接收,接收方式是setProperties的自动设置,然后在数据库里更新信息。 然后最开始出现了类似Incorrect string value: '\xE6\xB1\x9F\xE5\xAE\x81...' for column ‘note' 的错误信息,所以我就尝试单独设置note,用iso8859-1解码再编码再设置,解码后就不再报错了,但是会出现乱码,而且不管我用任何编码方式都是乱码,并且其他text都没有乱码唯独textarea有。我尝试过GBK,UTF-8,重新用iso8859-1,甚至latin1都试过了还是乱码,我就佛了。 下面 是一些或许会有用的信息:数据库连接的url里相关信息是useUnicode=true&characterEncoding=GBK;request.setCharacterEncoding("GBK")或者UTF-8都试过,set和不set都试过,form是get和post都试过,JSP文件最上面那几个charset=UTF-8和=GBK都试过,数据库里character_set_client=gbk, character_set_connection=gbk, character_set_databse=latin1, character_set_filesystem=binary, character_set_results=gbk, character_set_server =latin1, character_set_system=utf8;然后还试过在textarea里加入属性style="word-break:break-all;word-wrap: break-word;",不过貌似是为了解决换行问题的,反正也是没用。噢,最后提一下,这个textarea的乱码不是一堆看不懂的字符,就是纯粹的???,不知道这个信息有没有用,希望有大神来解答一下小弟的问题,不胜感激。
JSP用JAVABEAN传整型值时,如果数值为一位,接收到的值为0,两位以上的值正常。
现象如题,环境为MYECLIPSE和TOMCAT6,代码如下: 提交数据的文件department_add.jsp: <%@ page contentType="text/html" pageEncoding = "GBK"%> <%@ page import="com.lb.teashop.factory.*,com.lb.teashop.vo.*"%> <jsp:useBean id="department" scope="request" class="com.lb.teashop.vo.DepartmentBean"/> <html> <head><title>连锁店信息维护</title></head> <script type="text/javascript" src="../js/set_editable.js"></script> <% request.setCharacterEncoding("GBK"); //解决中文乱码问题 %> <body> <h3>添加连锁店</h3> <% String id = request.getParameter("id"); if(!(null == id || "".equals(id))){ //指定code时,显示对应信息 try{ DepartmentBean dpt=DAOFactory.getDepartmentDAOInstance().findDepartmentById(Integer.parseInt(id)); //out.println("dgc_code:" + dpt.getName()); department = dpt; //out.println("department_id:" + department.getId()); %> <form action="department_update_do.jsp" method="post"> <table> <tr> <td>店名:</td> <td> <input type="text" id="id_edit" name="id" value="<%=department.getId()%>" readonly> </td> <td> <input type="text" id="name_edit" name="name" value="<%=department.getName() %>" readonly> </td> </tr> <tr> <td>地址:</td> <td> <textarea id="address_edit" name="address" rows="6" cols="40" readonly><%=department.getAddress()%></textarea> <br><%=department.getErrorMsg("errAddress")%> </td> </tr> <tr> <td>电话:</td> <td> <input type="text" id="phone_edit" name="phone" readonly value="<%=department.getPhone()%>"> <%=department.getErrorMsg("errPhone")%> </td> </tr> <tr> <td>传真:</td> <td> <input id="fax_edit" name="fax" readonly value="<%=department.getFax()%>"> <%=department.getErrorMsg("errFax")%> </td> </tr> <tr> <td>测试号:</td> <td> <input id="apply_page_sn_edit" name="apply_page_sn" readonly value="<%=department.getApply_page_sn()%>"> <%=department.getErrorMsg("errApply_page_sn")%> </td> </tr> <tr> <td><input type="button" value="修改" onclick="set_editable();"></td> <td><input type="submit" value="提交"></td> </tr> </table> </form> <% }catch(Exception e){ e.printStackTrace(); } }else{ //未指定code时,显示空白录入界面。 %> <form action="department_add_do.jsp" method="post"> <table> <tr> <td>连锁店名称:</td> <td> <input type="text" name="name" > <%=department.getErrorMsg("errName")%> </td> </tr> <tr> <td>拼音码:</td> <td> <input type="text" name="py_code" ></input> <br><%=department.getErrorMsg("errPy_code")%> </td> </tr> <tr> <td>地址:</td> <td> <textarea id="address" name="address" rows="6" cols="40"></textarea> <br><%=department.getErrorMsg("errPy_code")%> </td> </tr> <tr> <td>电话:</td> <td> <input type="text" name="phone"></input> <br><%=department.getErrorMsg("errPhone")%> </td> </tr> <tr> <td>传真:</td> <td> <input type="text" name="fax" ></input> <br><%=department.getErrorMsg("errFax")%> </td> </tr> <tr> <td><input type="submit" value="添加"></td> <td><input type="reset" value="重置"></td> </tr> </table> </form> <% } %> </body> </html> JAVABEAN文件DepartmentBean.java: /** * */ package com.lb.teashop.vo; import java.io.Serializable; import java.util.HashMap; import java.util.Map; /** * @author Administrator * */ public class DepartmentBean implements Serializable{ /** * */ private static final long serialVersionUID = 1L; private int id; private String name; private String py_code; private String address; private String phone; private String fax; private int apply_page_sn; private int page_sn; private Map<String,String>errors=null; //声明一个保存全部错误信息的Map集合 public DepartmentBean(){ //this.code=""; this.name=""; this.py_code=""; this.errors = new HashMap<String,String>(); //实例化Map对象,保存错误信息 } public boolean isValidate(){ //数据验证操作 boolean flag = true; // //System.out.println(this.name); // //System.out.println(this.comment); // if(this.name==null || "".equals(this.name)){ // flag = false; // //System.out.print(this.name); // errors.put("errName", "请输入商品类别名称。"); //保存错误信息 // } // if(this.py_code==null || "".equals(this.py_code)){ // flag = false; // errors.put("errComment", "请输入规格描述,长度不超过150个汉字。"); // }else if(this.py_code.length()>15){ // flag = false; // //System.out.println(this.specification.length()); // errors.put("errComment", "规格描述是不超过150个字的中文。"); // } return flag; } public String getErrorMsg(String key){ String value = this.errors.get(key); return value == null?"":value; //返回value对应的内容 } /** * @return the id */ public int getId() { return id; } /** * @param id the id to set */ public void setId(int id) { this.id = id; } /** * @return the name */ public String getName() { return name; } /** * @param name the name to set */ public void setName(String name) { this.name = name; } /** * @return the py_code */ public String getPy_code() { return py_code; } /** * @param py_code the py_code to set */ public void setPy_code(String py_code) { this.py_code = py_code; } /** * @return the address */ public String getAddress() { return address; } /** * @param address the address to set */ public void setAddress(String address) { this.address = address; } /** * @return the phone */ public String getPhone() { return phone; } /** * @param phone the phone to set */ public void setPhone(String phone) { this.phone = phone; } /** * @return the fax */ public String getFax() { return fax; } /** * @param fax the fax to set */ public void setFax(String fax) { this.fax = fax; } /** * @return the apply_page_sn */ public int getApply_page_sn() { return apply_page_sn; } /** * @param apply_page_sn the apply_page_sn to set */ public void setApply_page_sn(int apply_page_sn) { this.apply_page_sn = apply_page_sn; } /** * @return the page_sn */ public int getPage_no() { return page_sn; } /** * @param page_sn the page_sn to set */ public void setPage_no(int page_sn) { this.page_sn = page_sn; } } 接收数据的文件department_update_do.jsp: <%@ page contentType="text/html" pageEncoding = "GBK"%> <%@ page import="com.lb.teashop.factory.*" %> <jsp:useBean id="department" scope="request" class="com.lb.teashop.vo.DepartmentBean"></jsp:useBean> <jsp:setProperty name = "department" property="*"></jsp:setProperty> <html> <head><title>连锁店信息维护</title></head> <% request.setCharacterEncoding("GBK"); //解决中文乱码问题 %> <head><title>添加连锁店</title></head> <body> <%=department.getId() %><br> <%=department.getName() %><br> <%=department.getAddress() %><br> <%=department.getPhone() %><br> <%=department.getFax() %><br> <%=department.getApply_page_sn() %><br> <% if(department.isValidate()){ try{ if(DAOFactory.getDepartmentDAOInstance().doUpdateDepartment(department)>0 ){ %> <h3>商品信息修改成功!</h3> <% response.setHeader("refresh","2;URL=department_list.jsp"); }else{ %> <h3>商品信息修改失败!</h3> <% response.setHeader("refresh","2;URL=department_add.jsp?id="+department.getId()); } }catch(Exception e){ e.printStackTrace(); //在Tomcat后台打印 } }else{ %> <jsp:forward page="department_add.jsp?id=<%=department.getId() %>"></jsp:forward> <% //response.setHeader("refresh","2;URL=department_add.jsp"); } %> </body> </html> 全部的整型变量如果小于10,接收文件看到的都为0,大于等于10的都没问题。求大牛指点迷津!非常感谢!
利用十一假期做了两个J2EE小项目,遇到了个小问题,向大家询问!
&nbsp; 利用十一20多天的BT假期,做了两个小项目。开发环境是myeclipse+sqlserver2000+tomcat6.0,利用的jdbc odbc桥连接数据库,账号sa,密码admin.第一个项目myshopping完全独立做的,第二个项目mybbs静态代码是从清华大学出版的《JSP动态开发实录》书拷贝的,这里声明下并没有进行任何商业用途从而或得利益数据库也是书上的,动态代码完全自己独立编写。 <br />&nbsp; 说下我出现的问题,我的项目是用myeclipse编写的,程序方面应该没问题,如果用在myeclipse下部署的外部或者内部tomcat都可以对其页面进行正常访问,但是如果项目离开myeclipse的话,直接使用tomcat进行访问,就会发生错误,观察下错误都是是javabean的返回值出现了空值现象,也就是说,可以调用javabean,也可以找到其中的方法,但是问题发生在,只要方法里面的程序有返回值,结果总是返回空值。 <br />&nbsp;&nbsp; 希望对这个问题有兴趣的朋友们能够帮助我下,本人新手,这学期才开的JSP和数据库,算下学习时间不到一个半月,所以代码写的也是很差,希望高手多批评指教! <br />&nbsp;&nbsp;&nbsp; 我把项目正常运行和出现错误的图像都贴出来,麻烦有时间的高手请指教下!<br /><strong>问题补充:</strong><br />&nbsp;&nbsp;&nbsp;&nbsp; 先解释下,我的数据库链接应该没问题,使用的是“过时”的JDBC-ODBC链接的,昨晚我也使用了JDBC直接访问数据库,把其jar包放在了lib文件夹中,其结果和JDBC-ODBC方式是一样的。至于目录结构,我直接使用了myeclipse打包成的war包,放在tomcat中,如果直接在myeclipse中启动tomcat,可以正常访问页面,但如果离开了myeclipse,结果就会出现空指针异常,至于刚才蔡华江前辈说的JDK不一致问题。我的电脑里面就一个JDK1.6额。 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 对于treblesoftware前辈说的我贬低了J2EE问题,以后我会注意的。像这样的问题应该说成是JSP+JAVAbean? <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wendal前辈质疑我没有利用框架的问题---我这学期才开的JSP和数据库,算下才接触了一个多月,因此没来得及学习SSH,现在正在学SERVLET。等寒假的时候会自学下SSH。然后做个项目出来的! <br /> <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 可能我的问题是比较幼稚的错误,但我想这些都是我编程到来上面的必修课吧!&nbsp;&nbsp; <br /><strong>问题补充:</strong><br />&nbsp;&nbsp;&nbsp;&nbsp; sunlightcs 的要求---出来JAVAeye貌似我把帖子发错去了论坛,在那里面我已经把错误图片贴了出来,等我正常访问的图片和出错的贴出来的。 <br />&nbsp;&nbsp; <br /><strong>问题补充:</strong><br />&nbsp;&nbsp; <span style="color: red">---myeclipse启动的tomcat可不是1.6的JDK,试着在将tomcat的启动jdk改为myeclipse的jdk。---</span> <br />&nbsp;&nbsp; 我感觉好像应该是像您所说的这个问题,但是我没找到把tomcat中的JDK改成Myeclipse的JDK方法额,是在tomcat目录下conf目录中的web.xml文件作修改么?<br /><strong>问题补充:</strong><br /><span style="color: red">---你这应该是没有连接上数据库了。---</span> <br /> <br />&nbsp;&nbsp;&nbsp; 但是为什么同样的代码同样的目录在myeclipse中启动tomcat就可以了?而离开myeclipse就出现那个错误?我用的是JDBC-ODBC连接方式,是不是不需要JDBCSQLSERVER jar包?<br /><strong>问题补充:</strong><br />&nbsp;&nbsp; 多谢这么多前辈的热心回答。虽然我还没有调试出来,但是感觉离问题的答案越来越近了,谢谢!!
新手,useBean问题,求帮忙
jsp页面 ``` <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>useBean 测试页面</title> </head> <body> <h1>useBean测试页面</h1> <jsp:useBean id="person" class="test.Person" scope="page"></jsp:useBean> <jsp:setProperty property="name" name="person" value="xiaowang"/> <jsp:setProperty property="age" name="person" value="65" /> <jsp:getProperty property="name" name="person"/><br> <jsp:getProperty property="age " name="person"/><br> </body> </html> ``` javaBean代码 ``` package test; public class Person { private String name; private int age; public Person(){} public Person(String name,int age){ this.name=name; this.age=age; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } } ``` 运行后结果: 要么就是找不到类,要么就是属性值找不到。求大神指教 type Exception report message Cannot find any information on property 'age ' in a bean of type 'test.Person' description The server encountered an internal error that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: Cannot find any information on property 'age ' in a bean of type 'test.Person' org.apache.jasper.runtime.JspRuntimeLibrary.getReadMethod(JspRuntimeLibrary.java:825) org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1144) org.apache.jasper.compiler.Node$GetProperty.accept(Node.java:1140) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2444) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2450) org.apache.jasper.compiler.Node$Root.accept(Node.java:474) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2392) org.apache.jasper.compiler.Generator.generate(Generator.java:3581) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:251) org.apache.jasper.compiler.Compiler.compile(Compiler.java:374) org.apache.jasper.compiler.Compiler.compile(Compiler.java:354) org.apache.jasper.compiler.Compiler.compile(Compiler.java:341) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:662) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) note The full stack trace of the root cause is available in the Apache Tomcat/7.0.68 logs. ``` ```
java 如何保存、读取数据库字段为blob类型的值
java 如何保存、读取javaBean中定义String类型,oracle数据库字段为blob类型的值 这是我的业务逻辑代码 try { String encoding = "GBK"; File file = new File("E:\\workspaceNeuSoft\\tomcat7.0.40\\logs\\localhost.2015-12-07.log"); if (file.isFile() && file.exists()) { // 判断文件是否存在 InputStreamReader read = new InputStreamReader( new FileInputStream(file), encoding);// 考虑到编码格式 BufferedReader bufferedReader = new BufferedReader(read); String lineTxt = null; while ((lineTxt = bufferedReader.readLine()) != null) { // System.out.println(lineTxt); interfaceLog.setFwqIp(ip); interfaceLog.setJkLog(lineTxt); interfaceLogService.createInterfaceLog(interfaceLog); } read.close(); } else { System.out.println("找不到指定的文件"); } } catch (Exception e) { System.out.println("读取文件内容出错"); e.printStackTrace(); } 这个是mybatis中代码 <insert id="save" parameterType="interfaceLog"> <selectKey keyProperty="rowId" order="BEFORE" resultType="long"> SELECT seq_neu_interfacelog_id.NEXTVAL FROM DUAL </selectKey> <![CDATA[ INSERT INTO neu_interfacelog DS (DS.ROW_ID, DS.CREATE_BY, DS.CREATE_DATE, DS.REMARK, DS.FWQ_IP, DS.INTERFACELOG ) VALUES (#{rowId}, #{createBy}, SYSDATE, #{remark}, #{fwqIp}, #{jkLog}) ]]> </insert> 现在控制台报异常 015-12-08 15:00:00,620 INFO org.quartz.plugins.history.LoggingTriggerHistoryPlugin.triggerComplete:432 - Trigger neuSoftWorkPlatform_TRIGGER_GROUP.interfaceLogExpireBean completed firing job neuSoftWorkPlatform_JOB_GROUP.interfaceLogExpire at 15:00:00 12/08/2015 with resulting trigger instruction code: DO NOTHING org.springframework.jdbc.UncategorizedSQLException: ### Error updating database. Cause: java.sql.SQLException: ORA-01465: 无效的十六进制数字 ### The error may exist in file [E:\workspaceNeuSoft\neuSoftWorkPlatform\neuSoftWorkPlatform-biz\target\classes\mybatis\mappers\interfaceLog\InterfaceLogMapper.xml] ### The error may involve com.neusoft.interfaceLog.dao.InterfaceLogDAO.save-Inline ### The error occurred while setting parameters ### SQL: INSERT INTO neu_interfacelog DS (DS.ROW_ID, DS.CREATE_BY, DS.CREATE_DATE, DS.REMARK, DS.FWQ_IP, DS.INTERFACELOG ) VALUES (?, ?, SYSDATE, ?, ?, ?) ### Cause: java.sql.SQLException: ORA-01465: 无效的十六进制数字 ; uncategorized SQLException for SQL []; SQL state [72000]; error code [1465]; ORA-01465: 无效的十六进制数字 ; nested exception is java.sql.SQLException: ORA-01465: 无效的十六进制数字 at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:71) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:365) at com.sun.proxy.$Proxy27.insert(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:237) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:79) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:40) at com.sun.proxy.$Proxy86.save(Unknown Source) at com.neusoft.interfaceLog.service.impl.InterfaceLogServiceImpl.createInterfaceLog(InterfaceLogServiceImpl.java:60) at com.haier.openplatform.showcase.quartz.InterfaceLogExpireJob.execute(InterfaceLogExpireJob.java:52) at org.quartz.core.JobRunShell.run(JobRunShell.java:213) at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557) Caused by: java.sql.SQLException: ORA-01465: 无效的十六进制数字 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216) at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:955) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285) at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390) at com.haier.openplatform.jdbc.HOPPraparedStatement$3.run(HOPPraparedStatement.java:183) at com.haier.openplatform.jdbc.HOPPraparedStatement$3.run(HOPPraparedStatement.java:180) at com.haier.openplatform.jdbc.HOPPraparedStatement.doProfile(HOPPraparedStatement.java:382) at com.haier.openplatform.jdbc.HOPPraparedStatement.execute(HOPPraparedStatement.java:180) at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:41) at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:66) at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:45) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:108) at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:145) at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:134) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:355) ... 9 more
The static method getCon() from the type PoolConnect should be accessed in a sta
<p>请教各位大侠。我连接Mysql时用到了连接池。 在连接池的类中用到了static函数。然后Jsp页面中调用此函数时总出现:The static method getCon() from the type PoolConnect should be accessed in a static way 这个警告。</p> <p> </p> <p>下面是我的连接池的类:</p> <p>package javabean1;<br>import java.sql.Connection;<br>import javax.naming.Context;<br>import javax.naming.InitialContext;<br>import javax.sql.DataSource;<br> <br>public class PoolConnect {<br>      public static Connection getCon() {<br>          Connection con = null;<br>          try {<br>               Context context=new InitialContext();<br>               DataSource  ds=(DataSource)context.lookup("java:/comp/env/jdbc/TestDB");<br>               con=ds.getConnection();<br>           } catch (Exception e) {<br>               e.printStackTrace();<br>          }<br>          return con;<br>     }<br>}</p> <p> </p> <p>下面是我调用语句:</p> <p>&lt;jsp:useBean id="pool" class="javabean1.PoolConnect" scope="page"&gt;&lt;/jsp:useBean&gt;(页面中引用连接池的类)</p> <p>调用类:</p> <p>Connection conn = pool.getCon();  </p> <p> </p> <p>虽然警告没有影响执行结果,但我实在搞不清楚上面的警告时怎么回事。希望有大侠能解释。谢谢</p> <p> </p>
两个JSP网页整合到一个网页时报错,路径问题求解
工作目录(即工程名)是/ChatRoomForTest 工程文件已打包,附在后面 注: ChatRoomForTest.zip是今天中午修改的第一个工程,当时还能正常访问input.jsp,至少提交后还能停留在原页面 ChatRoomForTest1.zip是今天晚上修改的,现在输入聊天内容提交后自动跳转到http://localhost:8080/chatpage/input.jsp,正确路径应为http://localhost:8080/ChatRoomForTest/chatpage/input.jsp 本来想做包含4个JSP的网页的,用框架实现,故设计了info.jsp(显示个人信息),input.jsp(输入聊天内容),output.jsp(显示聊天内容),visited.jsp(显示聊天室进入人员情况) 现只进行input.jsp和output.jsp的整合,就出现下面所说的错误(所用的是ChatRoomForTest.zip) /ChatRoomForTest/chatpage目录下的output.jsp和input.jsp单独加载可以正常显示(除去我加载的两个JavaBean Person.java和ChatRecord.java时显示的UserName为Null,其他一切正常), 但是我把它们整合到一个框架后提示错误,框架是这么写的: <frameset rows="80,*" frameborder="no" border="0" framespacing="0"> <frame src="output.jsp" name="topFrame" scrolling="No" noresize="noresize" id="topFrame" /> <frame src="input.jsp" name="mainFrame" id="mainFrame" /> </frameset> <noframes> 访问http://localhost:8080/ChatRoomForTest/chatpage.jsp 具体报错如下: HTTP Status 404 - /ChatRoomForTest/output.jsp -------------------------------------------------------------------------------- type Status report message /ChatRoomForTest/output.jsp description The requested resource (/ChatRoomForTest/output.jsp) is not available. -------------------------------------------------------------------------------- Apache Tomcat/6.0.33 HTTP Status 404 - /ChatRoomForTest/input.jsp -------------------------------------------------------------------------------- type Status report message /ChatRoomForTest/input.jsp description The requested resource (/ChatRoomForTest/input.jsp) is not available. 根据提示,我猜是URL的相对地址出错(因为我的output.jsp和input.jsp是放在WEBROOT文件夹的chatpage文件夹下,所以requested resource(/ChatRoomForTest/input.jsp)显示错误),尝试修改路径,但是昨天晚上一直在调试,终未成功,不知道问题究竟出在哪里,恳请各位帮忙解答,谢谢啦
c3p0连接mysql,两web配置驱动一样,一个正常连接,另一个就报错,望大手解答一下个
如题目所说,2个web项目,配置文件完全一致,除了数据库名称更改了一下,但就是一个可以正常连接并读取,另一个不可以.![图片说明](https://img-ask.csdn.net/upload/201901/05/1546694612_788442.jpg),![图片说明](https://img-ask.csdn.net/upload/201901/05/1546694646_180453.jpg) 这两个是数据库的截图,都在本地下,一个web15,一个web17. 接下来是两个数据库的具体配置及jar版本![图片说明](https://img-ask.csdn.net/upload/201901/05/1546694752_134502.jpg)15![图片说明](https://img-ask.csdn.net/upload/201901/05/1546694756_64169.jpg)17, 15可以正常读取并显示页面,这里我为了省事直接输出一行了![图片说明](https://img-ask.csdn.net/upload/201901/05/1546694917_605779.jpg),控制台也正常,![图片说明](https://img-ask.csdn.net/upload/201901/05/1546694967_209297.jpg). 但是到了17就直接报错了,是根本就连接不了数据库,直接出现错误,我是真的没招了,请大神解答一下,本来找的资料学习的结果出了这种情况真的难受.17控制台错误![图片说明](https://img-ask.csdn.net/upload/201901/05/1546695129_400901.jpg),17页面显示![图片说明](https://img-ask.csdn.net/upload/201901/05/1546695154_301226.jpg),17具体代码实现,Servlet![图片说明](https://img-ask.csdn.net/upload/201901/05/1546695229_352965.jpg),Jsp![图片说明](https://img-ask.csdn.net/upload/201901/05/1546695236_696564.jpg),15代码我就不贴了,基本一致,就是把javaBean改了改,然后把BeanListHandler里面的也改了改,总体思路是一致的,但是就是一个可以输出一个无法输出.顺带说下,我上网查了很多,都没用,权限也有,就是报错.
如何从Struts2 action类传值到jsp页面中
** 我set进JAVAben类的数据在jsp里面取不到值,有没有人能帮帮忙,好久没能解决这个问题。最好是能直接把代码列出来。** **设置数据代码** ``` public class ShowShare extends ActionSupport{ String title ; public HashMap<String, String> info=new HashMap<String, String>(); public List<String>list; public String getTitle() { return title; } public HashMap<String, String> getInfo() { return info; } public void setInfo(HashMap<String, String> info) { this.info = info; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getImg1() { return img1; } public void setImg1(String img1) { this.img1 = img1; } public String getImg2() { return img2; } public void setImg2(String img2) { this.img2 = img2; } public String getImg3() { return img3; } public void setImg3(String img3) { this.img3 = img3; } String content ; String img1; String img2; String img3; public String execute(){ System.out.println("1"+title); System.out.println("1"+content); System.out.println("1"+img1); System.out.println("1"+img2); System.out.println("1"+img3); ShowShareJavaBean show1d=new ShowShareJavaBean(); show1d.setTitle(this.getTitle()); show1d.setContent(this.getContent()); show1d.setImg1(this.getImg1()); show1d.setImg2(this.getImg2()); show1d.setImg3(this.getImg3()); ActionContext.getContext().getSession().put("title",this.getTitle()); ActionContext.getContext().getSession().put("content",this.getContent()); ActionContext.getContext().getSession().put("img1",this.getImg1()); ActionContext.getContext().getSession().put("img2",this.getImg2()); ActionContext.getContext().getSession().put("img3",this.getImg3()); System.out.println("4"+show1d.getTitle()); System.out.println("4"+show1d.getContent()); System.out.println("4"+show1d.getImg1()); System.out.println("4"+show1d.getImg2()); System.out.println("4"+show1d.getImg3()); info.put("success", "success"); return SUCCESS; } } ``` **JSP代码** ``` <%@page import="com.yiibai.user.action.ShowShare"%> <%@page import="com.yiibai.utils.ShowShareJavaBean"%> <%@ taglib uri="/struts-tags" prefix="s" %> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <%@page import="java.text.SimpleDateFormat"%> <%@page language="java" import="java.util.* ,java.awt.*" errorPage="jsps/error.jsp" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html;charset=iso-8859-1" /> <meta content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=yes" name="viewport" /> <meta name="description" content="Responstent is a jQuery plugin that automagically makes your user generated content responsive. Video's, tables, images and maps, respontent'll make it fit." /> <title>内容分享详情 </title> <script src="http://www.jq22.com/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript" src="js/layout.js"></script> <script type="text/javascript" src="js/jquery.respontent.min.js"></script> <link type="text/css" rel="stylesheet" href="css/normalize.css" /> <link type="text/css" rel="stylesheet" href="css/style.css" /> <link type="text/css" rel="stylesheet" href="css/layout.css" /> <link type="text/css" rel="stylesheet" href="css/jquery.respontent.css" /> </head> <body> <jsp:useBean id="student" class = "com.yiibai.utils.ShowShareJavaBean" scope="session" ></jsp:useBean> <% ShowShareJavaBean showshare1=new ShowShareJavaBean(); String title=showshare1.getTitle(); String content=showshare1.getContent(); String img1=showshare1.getImg1(); String img2=showshare1.getImg2(); String img3=showshare1.getImg3(); System.out.println("2"+title); System.out.println("2"+content); System.out.println("2"+img1); System.out.println("2"+img2); System.out.println("2"+img3); %> <nav> <ul> <li><a href="#examples">Examples</a></li> <li><a href="#about">About</a></li> </ul> </nav> <div id="wrapper"> <section id="about"> <div class="explanation"> <h3><span> <jsp:getProperty name="student" property="title"/> </span></h3> <p class="text"><%=content%></p> </div> </section> <section id="examples"> <div class="example"> <h3><span>Images</span></h3> <div> <div class="w"> <img src=<%=img1%> width="500" height="290"/> </div> <div class="wo"> <img src=<%=img2%> width="500" height="290"/> </div> <div class="w" > <img src=<%=img3%> width="500" height="290"/> </div> </div> </div> </section> </div> </body> </html> ``` **JavaBean代码** ``` public class ShowShareJavaBean implements Serializable{ public String title ; public String content ; public String img1; public String img2; public ShowShareJavaBean(){ } public ShowShareJavaBean(String title,String content,String img1,String img2,String img3){ super(); this.title=title; this.content=content; this.img1=img1; this.img2=img2; this.img3=img3; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getImg1() { return img1; } public void setImg1(String img1) { this.img1 = img1; } public String getImg2() { return img2; } public void setImg2(String img2) { this.img2 = img2; } public String getImg3() { return img3; } public void setImg3(String img3) { this.img3 = img3; } public String img3; } ```
使用JAX-RS框架搭建WebService使用Hibernate访问MySQL出现不能实例化类问题
问题描述:大体思路是这样,我最近在做IOS开发想通过WebService访问服务器端数据库的数据,所以想使用Java搭建一个WebService于是在网上找资料使用Java实现的框架JAX-RS.代码如下: ## com.hnu.hibernate.bean包下的Student.java类 package com.hnu.hibernate.bean; import java.util.ArrayList; import java.util.Date; import java.util.List; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.OneToMany; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement @Entity @Table(name="student") public class Student { @Id @GeneratedValue(strategy=GenerationType.AUTO) private Integer userid; @Column(name="username") private String username; @Column(name="password") private String password; @Column(name="realname") private String realname; @Column(name="age") private Integer age; @Column(name="nationality") private String nationality; @Column(name="language") private String language; @Column(name="year") private float year; @Column(name="studyabroadschool") private String studyabroadschool; public Integer getUserid() { return userid; } public void setUserid(Integer userid) { this.userid = userid; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getRealname() { return realname; } public void setRealname(String realname) { this.realname = realname; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public String getNationality() { return nationality; } public void setNationality(String nationality) { this.nationality = nationality; } public String getLanguage() { return language; } public void setLanguage(String language) { this.language = language; } public float getYear() { return year; } public void setYear(float year) { this.year = year; } public String getStudyabroadschool() { return studyabroadschool; } public void setStudyabroadschool(String studyabroadschool) { this.studyabroadschool = studyabroadschool; } } ## com.hnu.hibernate.dao包 package com.hnu.hibernate.dao; import java.io.Serializable; import java.util.List; import org.hibernate.Session; import com.hnu.hibernate.util.HibernateSessionFactory; import com.hnu.hibernate.util.HibernateUtil; public class BaseDAO<T> { /** * 插入数据 * * @param object */ public int create(T object) { Session session = HibernateSessionFactory.getSession(); try { session.beginTransaction(); session.persist(object); session.getTransaction().commit(); } catch (Exception e) { session.getTransaction().rollback(); return 0; } finally { session.close(); } return 1; } /** * 更新数据库 * * @param object */ public int update(T object) { Session session = HibernateSessionFactory.getSession(); try { session.beginTransaction(); session.update(object); session.getTransaction().commit(); } catch (Exception e) { session.getTransaction().rollback(); return 0; } finally { session.close(); } return 1; } /** * 从数据库中删除 * * @param object */ public int delete(T object) { Session session = HibernateSessionFactory.getSession(); try { session.beginTransaction(); session.delete(object); session.getTransaction().commit(); } catch (Exception e) { session.getTransaction().rollback(); return 0; } finally { session.close(); } return 1; } /** * 查找单个Entity Bean * * @param clazz * @param id * @return */ @SuppressWarnings("unchecked") public T find(Class<? extends T> clazz, Serializable id) { Session session = HibernateSessionFactory.getSession(); try { session.beginTransaction(); return (T) session.get(clazz, id); } finally { session.getTransaction().commit(); session.close(); } } /** * 查找多个Entity Bean * * @param hql * @return */ @SuppressWarnings("unchecked") public List<T> list(String hql) { Session session =HibernateSessionFactory.getSession(); try { session.beginTransaction(); return session.createQuery(hql).list(); } finally { session.getTransaction().commit(); session.close(); } } } ## com.hnu.hibernate.bean包下生成的WebService Javabean StudentsResource.java类 package com.hnu.hibernate.bean; import java.util.List; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import com.hnu.hibernate.dao.BaseDAO; @Produces("application/xml") @Path("students") public class StudentsResource { private BaseDAO<Student> baseDAO=new BaseDAO<Student>(); @GET public List<Student> getStudents() { return baseDAO.list("from Student"); } } ## com.hnu.hibernate.util包下Hibernate获取Session的类 HibernateSessionFactory.java类 package com.hnu.hibernate.util; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.cfg.Configuration; import org.hibernate.service.ServiceRegistry; import org.hibernate.service.ServiceRegistryBuilder; /** * Configures and provides access to Hibernate sessions, tied to the * current thread of execution. Follows the Thread Local Session * pattern, see {@link http://hibernate.org/42.html }. */ 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; } } ## 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="hbm2ddl.auto">update</property> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <property name="connection.url">jdbc:mysql://localhost:3306/vocabularyadaptivetestingsystem?characterEncoding=UTF-8</property> <property name="connection.username">root</property> <property name="connection.password">123</property> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="show_sql">true</property> <property name="current_session_context_class">thread</property> <mapping class="com.hnu.hibernate.bean.Student"/> </session-factory> </hibernate-configuration> 使用本地的ApplicationServer使用Hibernate访问数据库没有任何问题。但是一旦把访问Hibernate的方法部署到Tomcat服务器上,访问WebService方法没有问题,但是使用WebService调用如下代码:baseDAO.list("from Student"); 就出现了如图所示的错误: ![图片说明](https://img-ask.csdn.net/upload/201607/20/1468960531_454273.png) 希望各位高手帮忙看一下,搞了好久没搞出来,重分酬谢!
网上下载的项目-导入ssm小米商城的后台项目访问登录界面login的时候无法跳转到其他页面是怎么回事?
在网上下载的ssm小米商城的后台项目 1:项目没有错误,,, 2:在访问登录界面login的时候- 却无法跳转到其他页面 3:数据库不知道是不是正常 4:我的数据库设置了管理员登录:admin 密码123456 5: 写了个generatorConfig.xml 6:::新增:看到有人回复说数据库的名字没有改: 我用的是mysql 数据库名是:shop 密码是:1234 userId我不知道是要赋值什么值,,一般不是userName吗??但是这个项目中的确实userId ,,所以我也给他 赋值了数据库的用户名 “root”但是这样配置根本就没有用,,同样无法跳转页面:::: 如果配置错了,,麻烦指出来,,非常感谢,,新手新手,,实力有限抱歉 求大神帮助,,,呜呜,,还是跳转不了 数据库图片: ![图片说明](https://img-ask.csdn.net/upload/201812/26/1545786449_770158.png) 数据库配置图: ![图片说明](https://img-ask.csdn.net/upload/201812/26/1545786860_325497.png) 按照网友提出的问题:修改数据库名和密码: 我把connectionURL 的 work_attendance也改成了shop,, 如下: //connectionURL="jdbc:mysql://localhost:3306/work_attendance" connectionURL="jdbc:mysql://localhost:3306/shop" <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/shop" userId="root" password="1234"> </jdbcConnection> 但是还是没有用,,,依然无法跳转,,总感觉没有错误,,,不知道错在哪了。。。。,,,,大神,,大神们求帮助中 代码如下: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" > <generatorConfiguration> <!--classPathEntry:数据库的JDBC驱动 --> <!-- location="D:\Develop\MvnRepo\mysql\mysql-connector-java\5.1.34\mysql-connector-java-5.1.34.jar"/> --> <classPathEntry location="D:\Users\lydia\workspaceSSH\shopCMS\src\main\webapp\WEB-INF\lib\mysql-connector-java-5.1.34.jar"/> <context id="MysqlTables" targetRuntime="MyBatis3"> <!-- 注意这里面的顺序确定的,不能随变更改 --> <!-- 自定义的分页插件 <plugin type="com.deppon.foss.module.helloworld.shared.PaginationPlugin"/> --> <!-- 可选的(0 or 1) --> <!-- 注释生成器 --> <commentGenerator> <!-- 是否去除自动生成的注释 true:是 : false:否 --> <property name="suppressAllComments" value="true"/> </commentGenerator> <!-- 必须的(1 required) --> <!--数据库连接的信息:驱动类、连接地址、用户名、密码 connectionURL="jdbc:mysql://localhost:3306/work_attendance" --> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/shop" userId="root" password="1234"> </jdbcConnection> ,, 登录界面 ![图片说明](https://img-ask.csdn.net/upload/201812/24/1545659180_616623.jpg) 每次一点击登录: console界面就显示: [DEBUG][2018-12-24 21:47:08] org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:845) DispatcherServlet with name 'SpringMVC' processing POST request for [/shopCMS/login/check] [DEBUG][2018-12-24 21:47:08] org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.getHandlerInternal(AbstractHandlerMethodMapping.java:297) Looking up handler method for path /login/check [DEBUG][2018-12-24 21:47:08] org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.getHandlerInternal(AbstractHandlerMethodMapping.java:302) Returning handler method [public java.lang.String com.shop.shopmanager.controller.LoginController.checkLogin(javax.servlet.http.HttpServletRequest) throws java.io.UnsupportedEncodingException,java.security.NoSuchAlgorithmException] [DEBUG][2018-12-24 21:47:08] org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:248) Returning cached instance of singleton bean 'loginController' [DEBUG][2018-12-24 21:47:08] org.mybatis.spring.SqlSessionUtils.getSqlSession(SqlSessionUtils.java:104) Creating a new SqlSession [DEBUG][2018-12-24 21:47:08] org.mybatis.spring.SqlSessionUtils.getSqlSession(SqlSessionUtils.java:140) SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7738ee46] was not registered for synchronization because synchronization is not active [DEBUG][2018-12-24 21:47:08] org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:110) Fetching JDBC Connection from DataSource [DEBUG][2018-12-24 21:47:08] org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:86) JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@41131e6d] will not be managed by Spring [DEBUG][2018-12-24 21:47:08] org.apache.ibatis.logging.jdbc.BaseJdbcLogger.debug(BaseJdbcLogger.java:139) ==> Preparing: SELECT cu.user_id AS user_id4, login_name, login_password, salt, user_name, real_name, sex, age, pic_img, cu.`status` AS status4, email, telephone, cu.create_time AS create_time4, cu.update_time AS update_time4, cr.role_id AS role_id2, role_name, role_sign, is_system, cr.`status` AS status2, cr.create_time AS create_time2, cr.update_time AS update_time2, cr.remarks AS remarks2, cm.menu_id AS menu_id1, parent_id, menu_type, menu_code, menu_name, sort, href, icon, cm.`status` AS status1, permission, cm.create_time AS create_time1, cm.update_time AS update_time1, cm.remarks AS remarks1 FROM cms_menu cm, cms_role cr, cms_role_menu crm, cms_user cu, cms_user_role cur WHERE crm.role_id = cr.role_id AND crm.menu_id = cm.menu_id AND cur.user_id = cu.user_id AND cur.role_id = cr.role_id AND cu.login_name = ?; [DEBUG][2018-12-24 21:47:08] org.apache.ibatis.logging.jdbc.BaseJdbcLogger.debug(BaseJdbcLogger.java:139) ==> Parameters: admin(String) [DEBUG][2018-12-24 21:47:08] org.apache.ibatis.logging.jdbc.BaseJdbcLogger.debug(BaseJdbcLogger.java:139) <== Total: 73 [DEBUG][2018-12-24 21:47:08] org.mybatis.spring.SqlSessionUtils.closeSqlSession(SqlSessionUtils.java:168) Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@7738ee46] [DEBUG][2018-12-24 21:47:08] org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:327) Returning JDBC Connection to DataSource [DEBUG][2018-12-24 21:47:08] org.apache.shiro.realm.AuthenticatingRealm.getAuthenticationInfo(AuthenticatingRealm.java:569) Looked up AuthenticationInfo [admin] from doGetAuthenticationInfo [DEBUG][2018-12-24 21:47:08] org.apache.shiro.realm.AuthenticatingRealm.cacheAuthenticationInfoIfPossible(AuthenticatingRealm.java:507) AuthenticationInfo caching is disabled for info [admin]. Submitted token: [org.apache.shiro.authc.UsernamePasswordToken - admin, rememberMe=false]. [DEBUG][2018-12-24 21:47:08] org.mybatis.spring.SqlSessionUtils.getSqlSession(SqlSessionUtils.java:104) Creating a new SqlSession [DEBUG][2018-12-24 21:47:08] org.mybatis.spring.SqlSessionUtils.getSqlSession(SqlSessionUtils.java:140) SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@33b81d6e] was not registered for synchronization because synchronization is not active [DEBUG][2018-12-24 21:47:08] org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:110) Fetching JDBC Connection from DataSource [DEBUG][2018-12-24 21:47:08] org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:86) JDBC Connection [com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl@41131e6d] will not be managed by Spring [DEBUG][2018-12-24 21:47:08] org.apache.ibatis.logging.jdbc.BaseJdbcLogger.debug(BaseJdbcLogger.java:139) ==> Preparing: SELECT cu.user_id AS user_id4, login_name, login_password, salt, user_name, real_name, sex, age, pic_img, cu.`status` AS status4, email, telephone, cu.create_time AS create_time4, cu.update_time AS update_time4, cr.role_id AS role_id2, role_name, role_sign, is_system, cr.`status` AS status2, cr.create_time AS create_time2, cr.update_time AS update_time2, cr.remarks AS remarks2, cm.menu_id AS menu_id1, parent_id, menu_type, menu_code, menu_name, sort, href, icon, cm.`status` AS status1, permission, cm.create_time AS create_time1, cm.update_time AS update_time1, cm.remarks AS remarks1 FROM cms_menu cm, cms_role cr, cms_role_menu crm, cms_user cu, cms_user_role cur WHERE crm.role_id = cr.role_id AND crm.menu_id = cm.menu_id AND cur.user_id = cu.user_id AND cur.role_id = cr.role_id AND cu.login_name = ?; [DEBUG][2018-12-24 21:47:08] org.apache.ibatis.logging.jdbc.BaseJdbcLogger.debug(BaseJdbcLogger.java:139) ==> Parameters: admin(String) [DEBUG][2018-12-24 21:47:08] org.apache.ibatis.logging.jdbc.BaseJdbcLogger.debug(BaseJdbcLogger.java:139) <== Total: 73 [DEBUG][2018-12-24 21:47:08] org.mybatis.spring.SqlSessionUtils.closeSqlSession(SqlSessionUtils.java:168) Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@33b81d6e] [DEBUG][2018-12-24 21:47:08] org.springframework.jdbc.datasource.DataSourceUtils.doReleaseConnection(DataSourceUtils.java:327) Returning JDBC Connection to DataSource 原密码:123456Dts7jk 加密之后的密码为:lZQ/OoEBjTylEoEfxoyWeQ== [DEBUG][2018-12-24 21:47:08] org.apache.shiro.web.servlet.SimpleCookie.addCookieHeader(SimpleCookie.java:226) Added HttpServletResponse Cookie [rememberMe=deleteMe; Path=/shopCMS; Max-Age=0; Expires=Sun, 23-Dec-2018 13:47:08 GMT] [DEBUG][2018-12-24 21:47:08] org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdviceChain.invoke(ResponseBodyAdviceChain.java:61) Invoking ResponseBodyAdvice chain for body=login_fail [DEBUG][2018-12-24 21:47:08] org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdviceChain.invoke(ResponseBodyAdviceChain.java:83) After ResponseBodyAdvice chain body=login_fail [DEBUG][2018-12-24 21:47:08] org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:163) Written [login_fail] as "text/plain;charset=ISO-8859-1" using [org.springframework.http.converter.StringHttpMessageConverter@395cf6a4] [DEBUG][2018-12-24 21:47:08] org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1018) Null ModelAndView returned to DispatcherServlet with name 'SpringMVC': assuming HandlerAdapter completed request handling [DEBUG][2018-12-24 21:47:08] org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:996) Successfully completed request [DEBUG][2018-12-24 21:47:08] org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:248) Returning cached instance of singleton bean 'sqlSessionFactory' [DEBUG][2018-12-24 21:47:08] org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:845) DispatcherServlet with name 'SpringMVC' processing GET request for [/shopCMS/login] [DEBUG][2018-12-24 21:47:08] org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.getHandlerInternal(AbstractHandlerMethodMapping.java:297) Looking up handler method for path /login [DEBUG][2018-12-24 21:47:08] org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.getHandlerInternal(AbstractHandlerMethodMapping.java:302) Returning handler method [public java.lang.String com.shop.shopmanager.controller.LoginController.login()] [DEBUG][2018-12-24 21:47:08] org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:248) Returning cached instance of singleton bean 'loginController' [DEBUG][2018-12-24 21:47:08] org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:931) Last-Modified value for [/shopCMS/login] is: -1 [DEBUG][2018-12-24 21:47:08] org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1225) Rendering view [org.springframework.web.servlet.view.JstlView: name 'login'; URL [/WEB-INF/views/login.jsp]] in DispatcherServlet with name 'SpringMVC' [DEBUG][2018-12-24 21:47:08] org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:166) Forwarding to resource [/WEB-INF/views/login.jsp] in InternalResourceView 'login' [DEBUG][2018-12-24 21:47:08] org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:996) Successfully completed request [DEBUG][2018-12-24 21:47:08] org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:248) Returning cached instance of singleton bean 'sqlSessionFactory' ``` ``` 我的数据库中有admin和密码 123456,,但是就是无法跳转到登录后的页面希望大佬能帮我看看是什么原因》》》 ------------------------------------ 后续添加,,,,麻烦大佬结合上述和下述看看是什么问题,,拜托拜托, 1:数据库用户表信息: ![图片说明](https://img-ask.csdn.net/upload/201812/28/1545962958_570862.png) 2:我的项目结构: ![图片说明](https://img-ask.csdn.net/upload/201812/28/1545962858_134226.png) 3:以下是登录控制器“LoginController”的代码: package com.shop.shopmanager.controller; import java.io.UnsupportedEncodingException; import java.security.NoSuchAlgorithmException; import javax.servlet.http.HttpServletRequest; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.subject.Subject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.shop.shopmanager.service.CmsUserService; /** * @Author 康健 * @Date 2017/8/14 14:54 */ @Controller @RequestMapping("login") public class LoginController { @Autowired private CmsUserService cmsUserService; /** * @Author JackWang [www.coder520.com] * @Date 2017/6/18 12:47 * @Description 登录页面 */ @RequestMapping public String login() { return "login"; } /** * @Author JackWang [www.coder520.com] * @Date 2017/6/18 12:47 * @Description 校验登录 */ @RequestMapping("/check") @ResponseBody public String checkLogin(HttpServletRequest request) throws UnsupportedEncodingException, NoSuchAlgorithmException { String username = request.getParameter("username"); String pwd = request.getParameter("password"); UsernamePasswordToken token = new UsernamePasswordToken(username, pwd); // token.setRememberMe(true); Subject subject = SecurityUtils.getSubject(); try { subject.login(token); SecurityUtils.getSubject().getSession().setTimeout(1800000); } catch (Exception e) { return "login_fail"; } return "login_succ"; } /* @RequestMapping("/register") @ResponseBody public String register(@RequestBody User user) throws UnsupportedEncodingException, NoSuchAlgorithmException { userService.createUser(user); return "succ"; }*/ } 4:UsernamePasswordToken 我没有这个类,这好像是一个方法-------网上好像说这是个认证机制,,不知道跳转不了跟这个有没有关系 网上解释:是最常见的用户名/密码的认证机制;同时,由于它实现了RememberMeAuthenticationToken接口,我们可以通过令牌设置“记住我”的功能。 但是,“已记住”和“已认证”是有区别的: 已记住的用户仅仅是非匿名用户,你可以通过subject.getPrincipals()获取用户信息。但是它并非是认证通过的用户,当你访问需要认证用户的功能时,你仍然需要重新提交认证信息。 这一区别可以参考淘宝网站,网站会默认记住登录的用户,再次访问网站时,对于非敏感的页面功能,页面上会显示记住的用户信息,但是当你访问网站账户信息时仍然需要再次进行登录认证。 5: 我的自定义数据库配置“jdbc.properties”: driverClassName=com.mysql.jdbc.Driver validationQuery=SELECT 1 jdbc_url=jdbc:mysql://localhost:3306/shop?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false jdbc_username=root jdbc_password=1234 6:"generatorConfig.xml" 这个就是上面的数据库驱动的配置 <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" > <generatorConfiguration> <!--classPathEntry:数据库的JDBC驱动 --> <!-- location="D:\Develop\MvnRepo\mysql\mysql-connector-java\5.1.34\mysql-connector-java-5.1.34.jar"/> --> <classPathEntry location="D:\Users\lydia\workspaceSSH\shopCMS\src\main\webapp\WEB-INF\lib\mysql-connector-java-5.1.34.jar"/> <context id="MysqlTables" targetRuntime="MyBatis3"> <!-- 注意这里面的顺序确定的,不能随变更改 --> <!-- 自定义的分页插件 <plugin type="com.deppon.foss.module.helloworld.shared.PaginationPlugin"/> --> <!-- 可选的(0 or 1) --> <!-- 注释生成器 --> <commentGenerator> <!-- 是否去除自动生成的注释 true:是 : false:否 --> <property name="suppressAllComments" value="true"/> </commentGenerator> <!-- 必须的(1 required) --> <!--数据库连接的信息:驱动类、连接地址、用户名、密码 connectionURL="jdbc:mysql://localhost:3306/work_attendance" --> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/shop" userId="root" password="1234"> </jdbcConnection> <!-- 可选的(0 or 1) --> <!-- 类型转换器或者加类型解析器 --> <!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer true,把JDBC DECIMAL 和 NUMERIC 类型解析为java.math.BigDecimal --> <javaTypeResolver> <property name="forceBigDecimals" value="false"/> </javaTypeResolver> <!-- 必须的(1 required) --> <!-- java模型生成器 --> <!-- targetProject:自动生成代码的位置 --> <javaModelGenerator targetPackage="com.coder520.user.entity" targetProject="D:\Develop\IDEAWorkPlace\work-attendance\src\main\java" > <!--TODO enableSubPackages:是否让schema作为包的后缀 --> <property name="enableSubPackages" value="true"/> <!-- 从数据库返回的值被清理前后的空格 --> <property name="trimStrings" value="true"/> </javaModelGenerator> <!-- 必须的(1 required) --> <!-- map xml 生成器 <sqlMapGenerator targetPackage="com.coder520.user.dao" targetProject="D:\Develop\IDEAWorkPlace\work-attendance\src\main\java"> <property name="enableSubPackages" value="true"/> </sqlMapGenerator> --> <sqlMapGenerator targetPackage="com.coder520.user.dao" targetProject="D:\Users\lydia\workspaceSSH\shopCMS\src\main\java"> <property name="enableSubPackages" value="true"/> </sqlMapGenerator> <!-- 可选的(0 or 1) --> <!-- mapper 或者就是dao接口生成器 --> <javaClientGenerator targetPackage="com.coder520.user.dao" targetProject="D:\Users\lydia\workspaceSSH\shopCMS\src\main\java" type="XMLMAPPER"> <property name="enableSubPackages" value="true"/> </javaClientGenerator> <!-- 必须的(1...N) --> <!-- pojo 实体生成器 --> <!-- tableName:用于自动生成代码的数据库表;domainObjectName:对应于数据库表的javaBean类名 --> <!-- schema即为数据库名 可不写 --> <table tableName="role" domainObjectName="Role" enableInsert="true" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> <!-- 忽略字段 可选的(0 or 1) --> <!-- <ignoreColumn column="is_use" /> --> <!--//无论字段是什么类型,生成的类属性都是varchar。 可选的(0 or 1) 测试无效 --> <!-- <columnOverride column="city_code" jdbcType="VARCHAR" /> --> </table> <table tableName="permission" domainObjectName="Permission" enableInsert="true" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> <!-- 忽略字段 可选的(0 or 1) --> <!-- <ignoreColumn column="is_use" /> --> <!--//无论字段是什么类型,生成的类属性都是varchar。 可选的(0 or 1) 测试无效 --> <!-- <columnOverride column="city_code" jdbcType="VARCHAR" /> --> </table> </context> </generatorConfiguration> 万分感谢大佬,,,,,帮我解决这问题我就认你当师傅,,,大佬 ,,拜托了,,,还需要什么麻烦留下言哈
JSP2.0技术手册中一个例子给我的困惑
作者讲解 javabean的范围的时候,特别举了个计数器的例子,一个javabean叫Counter.java, 然后在Counter.jsp中调用这个bean,同时Counter.jsp中include了一个Hello.jsp。应为Counter.jsp调用 bean的时候,设置的scope是 page,所以Hello.jsp没法使用 Counter.jsp调用的bean,这个没有问题。但是作者说,如果把 scope,改为 request(session,application)后,Hello.jsp就可以调用了。我做了实验,发现改变scope再republish后,Hello.jsp还是无法调用呢?抛出异常为“Attempted a bean operation on a null object.” 另外,如果我在Hello.jsp中再次调用<jsp:useBean id="myBean" scope="application" class="com.javastudy.ch8"/> ,Hello.jsp就能显示了。 代码如下: -------------------------------------------------------------------------- //Counter.java package com.javastudy.ch8; public class Counter { public Counter(){ } private int count = 0; public int getCount(){ count++; return count; } public void setCount(int newCount){ count = newCount; } } -------------------------------------------------------------------------------- //Counter.jsp <%@ page contentType="text/html;charset=Big5" %> <html> <head> <title>CH8 - Counter1.jsp</title> </head> <body> <h2>範圍為 Request的 JavaBean範例程式 - Counter1</h2> <jsp:useBean id="myBean" scope="session" class="com.javastudy.ch8"/> //用session,request,application,hello.jsp都无法使用 <p>您己參觀<font color="red"> <jsp:getProperty name="myBean" property="count"/> </font>次</p> <p>歡迎再次參觀</p> <jsp:include page="Hello.jsp" flush="true"/> </body> </html> ------------------------------------------------------------------------------- //Hello.jsp <%@ page contentType="text/html;charset=Big5" %> Hello ... 您好 感謝您第<font color="red"><jsp:getProperty name="myBean" property="count" /></font>次的光臨 [b]问题补充:[/b] 不好意思,我复制到这上面来的时候,搞错了,应该是 <jsp:useBean id="myBean" scope="session" class="com.javastudy.ch8.Counter"/> 这个不是我问题的错误所在。 [b]问题补充:[/b] 回楼下的Rowin,这个异常应该是跟Bean的作用域有关,我把scope设置成page,抛出这个异常可以理解,但是我把作用域设置成大到application都仍然有这个问题,我就没法理解了。是不是环境的问题哦? [b]问题补充:[/b] 回lovewhzlq,我用的tomcat是apache-tomcat-5.5.27.我遇到的问题和下面这个帖子中的问题一模一样 http://www.javaworld.com.tw/jute/post/view?bid=22&id=59329 [b]问题补充:[/b] 回panjava,我把<jsp:include page="Hello.jsp" flush="true"/> 换为 <jsp:include page="Hello.jsp" flush="true"> </jsp:include> 就抛新的异常了。。。。 ervlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: /Counter1.jsp(19,0) Expecting "jsp:param" standard action with "name" and "value" attributes 到底怎么回事啊? 我是在eclipse里建了个 dynamic web Project,然后绑定了tomcat为server.Tomcat 5.5.27, JDK1.6,Eclipse是最新的。 [b]问题补充:[/b] 书中代码,我上传上来了。那个Counter.java要自己写下。 [b]问题补充:[/b] 对了,我有个发现,把<jsp:include page="Hello.jsp" flush="true"/> 换成 <%@ include file="Hello.jsp"%>,就一切正常了。不晓得是什么原因。 [b]问题补充:[/b] 下面的链接中的人,也遇到了我同样的问题 http://topic.csdn.net/u/20090219/13/5c33d2a1-dbcc-4347-b643-72ee73d8f2d2.html [b]问题补充:[/b] 谢谢楼下的大哥们,小弟刚学J2EE,这两种的区别还不太了解,等下仔细看看你们的资料,难道是JSP2.0书上写错了?先做事去了,等下回来给分,谢谢各位。
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私有的数
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
此博客仅为我业余记录文章所用,发布到此,仅供网友阅读参考,如有侵权,请通知我,我会删掉。 补充 有不少读者留言说本文章没有用,因为天气预报直接打开手机就可以收到了,为何要多此一举发送到邮箱呢!!!那我在这里只能说:因为你没用,所以你没用!!! 这里主要介绍的是思路,不是天气预报!不是天气预报!!不是天气预报!!!天气预报只是用于举例。请各位不要再刚了!!! 下面是我会用到的两个场景: 每日下
死磕YOLO系列,YOLOv1 的大脑、躯干和手脚
YOLO 是我非常喜欢的目标检测算法,堪称工业级的目标检测,能够达到实时的要求,它帮我解决了许多实际问题。 这就是 YOLO 的目标检测效果。它定位了图像中物体的位置,当然,也能预测物体的类别。 之前我有写博文介绍过它,但是每次重新读它的论文,我都有新的收获,为此我准备写一个系列的文章来详尽分析它。这是第一篇,从它的起始 YOLOv1 讲起。 YOLOv1 的论文地址:https://www.c
知乎高赞:中国有什么拿得出手的开源软件产品?(整理自本人原创回答)
知乎高赞:中国有什么拿得出手的开源软件产品? 在知乎上,有个问题问“中国有什么拿得出手的开源软件产品(在 GitHub 等社区受欢迎度较好的)?” 事实上,还不少呢~ 本人于2019.7.6进行了较为全面的 回答 - Bravo Yeung,获得该问题下回答中得最高赞(236赞和1枚专业勋章),对这些受欢迎的 Github 开源项目分类整理如下: 分布式计算、云平台相关工具类 1.SkyWalk
20行Python代码爬取王者荣耀全英雄皮肤
引言 王者荣耀大家都玩过吧,没玩过的也应该听说过,作为时下最火的手机MOBA游戏,咳咳,好像跑题了。我们今天的重点是爬取王者荣耀所有英雄的所有皮肤,而且仅仅使用20行Python代码即可完成。 准备工作 爬取皮肤本身并不难,难点在于分析,我们首先得得到皮肤图片的url地址,话不多说,我们马上来到王者荣耀的官网: 我们点击英雄资料,然后随意地选择一位英雄,接着F12打开调试台,找到英雄原皮肤的图片
简明易理解的@SpringBootApplication注解源码解析(包含面试提问)
欢迎关注文章系列 ,关注我 《提升能力,涨薪可待》 《面试知识,工作可待》 《实战演练,拒绝996》 欢迎关注我博客,原创技术文章第一时间推出 也欢迎关注公 众 号【Ccww笔记】,同时推出 如果此文对你有帮助、喜欢的话,那就点个赞呗,点个关注呗! 《提升能力,涨薪可待篇》- @SpringBootApplication注解源码解析 一、@SpringBootApplication 的作用是什
西游记团队中如果需要裁掉一个人,会先裁掉谁?
2019年互联网寒冬,大批企业开始裁员,下图是网上流传的一张截图: 裁员不可避免,那如何才能做到不管大环境如何变化,自身不受影响呢? 我们先来看一个有意思的故事,如果西游记取经团队需要裁员一名,会裁掉谁呢,为什么? 西游记团队组成: 1.唐僧 作为团队teamleader,有很坚韧的品性和极高的原则性,不达目的不罢休,遇到任何问题,都没有退缩过,又很得上司支持和赏识(直接得到唐太宗的任命,既给
Python语言高频重点汇总
Python语言高频重点汇总 GitHub面试宝典仓库——点这里跳转 文章目录Python语言高频重点汇总**GitHub面试宝典仓库——点这里跳转**1. 函数-传参2. 元类3. @staticmethod和@classmethod两个装饰器4. 类属性和实例属性5. Python的自省6. 列表、集合、字典推导式7. Python中单下划线和双下划线8. 格式化字符串中的%和format9.
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外
ES6基础-ES6的扩展
进行对字符串扩展,正则扩展,数值扩展,函数扩展,对象扩展,数组扩展。 开发环境准备: 编辑器(VS Code, Atom,Sublime)或者IDE(Webstorm) 浏览器最新的Chrome 字符串的扩展: 模板字符串,部分新的方法,新的unicode表示和遍历方法: 部分新的字符串方法 padStart,padEnd,repeat,startsWith,endsWith,includes 字
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple/ 
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
你知道的越多,你不知道的越多 点赞再看,养成习惯 本文 GitHub https://github.com/JavaFamily 已收录,有一线大厂面试点思维导图,也整理了很多我的文档,欢迎Star和完善,大家面试可以参照考点复习,希望我们一起有点东西。 前前言 为啥今天有个前前言呢? 因为你们的丙丙啊,昨天有牌面了哟,直接被微信官方推荐,知乎推荐,也就仅仅是还行吧(心里乐开花)
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca
Python爬虫精简步骤1 获取数据
爬虫的工作分为四步: 1.获取数据。爬虫程序会根据我们提供的网址,向服务器发起请求,然后返回数据。 2.解析数据。爬虫程序会把服务器返回的数据解析成我们能读懂的格式。 3.提取数据。爬虫程序再从中提取出我们需要的数据。 4.储存数据。爬虫程序把这些有用的数据保存起来,便于你日后的使用和分析。 这一篇的内容就是:获取数据。 首先,我们将会利用一个强大的库——requests来获取数据。 在电脑上安装
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东
破14亿,Python分析我国存在哪些人口危机!
2020年1月17日,国家统计局发布了2019年国民经济报告,报告中指出我国人口突破14亿。 猪哥的朋友圈被14亿人口刷屏,但是很多人并没有看到我国复杂的人口问题:老龄化、男女比例失衡、生育率下降、人口红利下降等。 今天我们就来分析一下我们国家的人口数据吧! 更多有趣分析教程,扫描下方二维码关注vx公号「裸睡的猪」 即可查看! 一、背景 1.人口突破14亿 2020年1月17日,国家统计局发布
web前端javascript+jquery知识点总结
Javascript javascript 在前端网页中占有非常重要的地位,可以用于验证表单,制作特效等功能,它是一种描述语言,也是一种基于对象(Object)和事件驱动并具有安全性的脚本语言 ,语法同java类似,是一种解释性语言,边执行边解释。 JavaScript的组成: ECMAScipt 用于描述: 语法,变量和数据类型,运算符,逻辑控制语句,关键字保留字,对象。 浏览器对象模型(Br
Qt实践录:开篇
本系列文章介绍笔者的Qt实践之路。 背景 笔者首次接触 Qt 大约是十多年前,当时试用了 Qt ,觉得不如 MFC 好用。现在 Qt 的 API、文档等都比较完善,在年初决定重新拾起,正所谓技多不压身,将 Qt 当为一种谋生工具亦未尝不可。利用春节假期的集中时间,快速专攻一下。 本系列名为“Qt实践”,故不是教程,笔者对 Qt 的定位是“使用”,可以帮助快速编写日常的工具,如串口、网络等。所以不
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ......
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。   再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。   下文是原回答,希望能对你能有所启发。   如果我说,这个世界上人真的分三六九等,
为什么听过很多道理,依然过不好这一生?
记录学习笔记是一个重要的习惯,不希望学习过的东西成为过眼云烟。做总结的同时也是一次复盘思考的过程。 本文是根据阅读得到 App上《万维钢·精英日课》部分文章后所做的一点笔记和思考。学习是一个系统的过程,思维模型的建立需要相对完整的学习和思考过程。以下观点是在碎片化阅读后总结的一点心得总结。
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合
雷火神山直播超两亿,Web播放器事件监听是怎么实现的?
Web播放器解决了在手机浏览器和PC浏览器上播放音视频数据的问题,让视音频内容可以不依赖用户安装App,就能进行播放以及在社交平台进行传播。在视频业务大数据平台中,播放数据的统计分析非常重要,所以Web播放器在使用过程中,需要对其内部的数据进行收集并上报至服务端,此时,就需要对发生在其内部的一些播放行为进行事件监听。 那么Web播放器事件监听是怎么实现的呢? 01 监听事件明细表 名
3万字总结,Mysql优化之精髓
本文知识点较多,篇幅较长,请耐心学习 MySQL已经成为时下关系型数据库产品的中坚力量,备受互联网大厂的青睐,出门面试想进BAT,想拿高工资,不会点MySQL优化知识,拿offer的成功率会大大下降。 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计
一条链接即可让黑客跟踪你的位置! | Seeker工具使用
搬运自:冰崖的部落阁(icecliffsnet) 严正声明:本文仅限于技术讨论,严禁用于其他用途。 请遵守相对应法律规则,禁止用作违法途径,出事后果自负! 上次写的防社工文章里边提到的gps定位信息(如何防止自己被社工或人肉) 除了主动收集他人位置信息以外,我们还可以进行被动收集 (没有技术含量) Seeker作为一款高精度地理位置跟踪工具,同时也是社交工程学(社会工程学)爱好者...
作为程序员的我,大学四年一直自学,全靠这些实用工具和学习网站!
我本人因为高中沉迷于爱情,导致学业荒废,后来高考,毫无疑问进入了一所普普通通的大学,实在惭愧...... 我又是那么好强,现在学历不行,没办法改变的事情了,所以,进入大学开始,我就下定决心,一定要让自己掌握更多的技能,尤其选择了计算机这个行业,一定要多学习技术。 在进入大学学习不久后,我就认清了一个现实:我这个大学的整体教学质量和学习风气,真的一言难尽,懂的人自然知道怎么回事? 怎么办?我该如何更好的提升
前端JS初级面试题二 (。•ˇ‸ˇ•。)老铁们!快来瞧瞧自己都会了么
1. 传统事件绑定和符合W3C标准的事件绑定有什么区别? 传统事件绑定 &lt;div onclick=""&gt;123&lt;/div&gt; div1.onclick = function(){}; &lt;button onmouseover=""&gt;&lt;/button&gt; 注意: 如果给同一个元素绑定了两次或多次相同类型的事件,那么后面的绑定会覆盖前面的绑定 (不支持DOM事...
Python学习笔记(语法篇)
本篇博客大部分内容摘自埃里克·马瑟斯所著的《Python编程:从入门到实战》(入门类书籍),采用举例的方式进行知识点提要 关于Python学习书籍推荐文章 《学习Python必备的8本书》 Python语法特点: 通过缩进进行语句组织 不需要变量或参数的声明 冒号 1 变量和简单数据结构 1.1 变量命名 只能包含字母、数字和下划线,且不能以数字打头。 1.2 字符串 在Python中,用引号...
[Pyhon疫情大数据分析] 一.腾讯实时数据爬取、Matplotlib和Seaborn可视化分析全国各地区、某省各城市、新增趋势
思来想去,虽然很忙,但还是挤时间针对这次肺炎疫情写个Python大数据分析系列博客,包括网络爬虫、可视化分析、GIS地图显示、情感分析、舆情分析、主题挖掘、威胁情报溯源、知识图谱、预测预警及AI和NLP应用等。第一篇文章将分享腾讯疫情实时数据抓取,获取全国各地和贵州省各地区的实时数据,并将数据存储至本地,最后调用Maplotlib和Seaborn绘制中国各地区、贵州省各城市、新增人数的图形。希望这篇可视化分析文章对您有所帮助!
小白也会用的情人节表白神器
鉴于情人节女朋友总说直男,上网找了个模板,改了一下,发现效果还不错。然后又录了一个视频,发现凑合,能用。现在免费分享给程序员,去表白去吧。​​​​​​。当然比较low因为考研没时间优化,懒着优化了。 先看一下效果吧:页面太多了,这里我只放几个页面里面有音乐,还凑合不是太单调。 所有页面最后的合成效果: 接下来教大家如何使用: 新建文件夹:love 然后建立这几个...
论如何用python发qq消息轰炸虐狗好友
因为我的某个好友在情人节的时候秀恩爱,所以我灵光一闪制作了qq消息轰炸并记录了下来。 首先 我的编程环境是: windows 10系统 python3.6 记得要下载win32 pip install win32 思路介绍 其实也非常简单 将要发出去的句子储存在列表中 然后用随机模块调用 将随机出来的元素储存在剪贴板中 连接QQ 找到指定对象 疯狂输出 怎么样,简单吧 开始打代码吧 imp...
相关热词 c#导入fbx c#中屏蔽键盘某个键 c#正态概率密度 c#和数据库登陆界面设计 c# 高斯消去法 c# codedom c#读取cad文件文本 c# 控制全局鼠标移动 c# temp 目录 bytes初始化 c#
立即提问