tomcat连接idea后8080登陆不上

前因:
我在b站学习springmvc的框架,用**idea**跟着up主打了第一个网页,
然后**启动tomcat服务器,发现8080页面进不去了**,但是我追加项目路径后**项目可以进去**。(但是项目的链接跳转不成功,我觉得与本问题无关就不再赘述)
然后我即使从tomcat的bin目录下打开**setup.bat,8080页面依然上不去**(注意,在我用idea运行这个项目**之前,用setup.bat的方式是可以成功打开8080**的)
我怀疑是这个**项目中某个部分“污染”了我的tomcat**,为了验证这个想法,我**重装了tomcat**,运行setup,成功进入8080,再次用idea中那个项目连接tomcat进入,8080再次无法进入,**与第一次情况相同**。
图片说明图片说明
这是tomcat的配置页面

        破案了 我前端控制器里忘记加/了。。
           <url-pattern>/</url-pattern>

2个回答

跟项目没关系,是idea的问题,建议看看这篇文章 https://www.jianshu.com/p/1dcc62e3d7de
另外看一下你本地tomcat中webapps文件夹下是否有ROOT文件夹,里面存的就是欢迎界面,如果没有这个文件夹就算你的本地tomcat启动成功也无法访问欢迎界面。

可以先尝试一下不用IDE启动Tomcat(双击tomcat\bin\startup.bat脚本启动),进行访问;如果能够访问,就是IDE配置问题,不然就是Tomcat自身问题。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Intellij Idea 远程调试Tomcat时,无法通过JMX认证

在远程的公网服务器上Tomcat进行了如下的配置: ![图片说明](https://img-ask.csdn.net/upload/202004/22/1587544774_130505.png) 然后通过VisualVM或者JConsole能使用配置的用户名和密码正常登陆。 但Idea在远程调试连接的时候会报以下异常: ![图片说明](https://img-ask.csdn.net/upload/202004/22/1587545099_610075.png) 但如果我将Tomcat配置中的authenticate设为false,则Idea能正常连接。 --- 有什么办法能让Idea进行JMX的密码认证吗?服务器在公网上,不敢关认证。

tomcat修改默认端口没有用

tomcat默认8080端口,启动startup.bat,在浏览器中输入localhost:8080可以登陆; 关闭tomcat,之后修改端口8080为8888,启动tomcat后登陆8888没有显示,而登陆8080却仍可以显示,求指教。

为什么tomcat部署上,但是加载项目就是404,这是加载的日志

2015-7-13 22:30:31 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.20. 2015-7-13 22:30:31 org.apache.catalina.core.AprLifecycleListener init 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 2015-7-13 22:30:32 org.apache.coyote.http11.Http11AprProtocol init 信息: Initializing Coyote HTTP/1.1 on http-8080 2015-7-13 22:30:32 org.apache.coyote.ajp.AjpAprProtocol init 信息: Initializing Coyote AJP/1.3 on ajp-8009 2015-7-13 22:30:32 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 1472 ms 2015-7-13 22:30:32 org.apache.catalina.core.StandardService start 信息: Starting service Catalina 2015-7-13 22:30:32 org.apache.catalina.core.StandardEngine start 信息: Starting Servlet Engine: Apache Tomcat/6.0.29 2015-7-13 22:30:32 org.apache.catalina.startup.HostConfig deployDescriptor 信息: Deploying configuration descriptor host-manager.xml 2015-7-13 22:30:33 org.apache.catalina.startup.HostConfig deployDescriptor 信息: Deploying configuration descriptor manager.xml 2015-7-13 22:30:33 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory ROOT 2015-7-13 22:30:33 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory docs 2015-7-13 22:30:33 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory examples 2015-7-13 22:30:33 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory monitor 2015-7-13 22:30:48 org.apache.catalina.core.StandardContext start 严重: Error filterStart 2015-7-13 22:30:48 org.apache.catalina.core.StandardContext start 严重: Context [/monitor] startup failed due to previous errors 2015-7-13 22:30:48 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc 严重: The web application [/monitor] registered the JBDC driver [com.microsoft.sqlserver.jdbc.SQLServerDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 2015-7-13 22:30:48 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc 严重: The web application [/monitor] registered the JBDC driver [oracle.jdbc.driver.OracleDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 2015-7-13 22:30:48 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/monitor] appears to have started a thread named [HouseKeeper] but has failed to stop it. This is very likely to create a memory leak. 2015-7-13 22:30:48 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap 严重: The web application [/monitor] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@f7f725]) and a value of type [cn.rhytech.monitor.sys.dao.SysDao$$EnhancerByCGLIB$$4f523079] (value [cn.rhytech.monitor.sys.dao.SysDao@20713a72]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak. 2015-7-13 22:30:48 org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap 严重: The web application [/monitor] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@7ca9bd]) and a value of type [cn.rhytech.monitor.sys.dao.SysDao$$EnhancerByCGLIB$$4f523079] (value [cn.rhytech.monitor.sys.dao.SysDao@20713a72]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak. 2015-7-13 22:30:49 org.apache.coyote.http11.Http11AprProtocol start 信息: Starting Coyote HTTP/1.1 on http-8080 2015-7-13 22:30:49 org.apache.coyote.ajp.AjpAprProtocol start 信息: Starting Coyote AJP/1.3 on ajp-8009 2015-7-13 22:30:49 org.apache.catalina.startup.Catalina start 信息: Server startup in 16910 ms

IntelliJ idea Web项目配置问题(JDBC驱动注册失败)

今天想要把开发工具从Eclipse换成Intellij idea。于是把一个在Eclipse中开发的项目导入到了idea。各种配置完之后,项目可以启动,可以打开主页,但是无法登陆系统。控制台打印JDBC驱动注册失败,如图。请问这个问题怎么解决啊!各位大哥帮帮忙,小弟谢过啦! ![图片说明](https://img-ask.csdn.net/upload/201707/07/1499410224_172849.png) ![图片说明](https://img-ask.csdn.net/upload/201707/07/1499410236_207775.png) ![图片说明](https://img-ask.csdn.net/upload/201707/07/1499410249_960795.png) 另外数据库连接是没问题的。在Eclipse中启动也没有问题

用servlet做一个登陆,做完之后点击登陆按钮显示localhost拒绝我们的连接

![图片说明](https://img-ask.csdn.net/upload/201704/01/1491041037_304709.png)![这是c3p0配置,没有任何问题,已经测试过](https://img-ask.csdn.net/upload/201704/01/1491040279_801851.png) ![这是要点击登陆提交的代码 也是没有毛病的](https://img-ask.csdn.net/upload/201704/01/1491040377_825531.png) ![web.xml配置,也没有问题啊](https://img-ask.csdn.net/upload/201704/01/1491040446_40252.png) ![这是代码](https://img-ask.csdn.net/upload/201704/01/1491040709_920192.png) ![这是出现的问题](http://im g.ask.csdn.net/uploa d/201704/01/1491040619_332253.png)

请教下Maven项目启动没报错但登录不了localhost的问题

求大佬指点下啊,本菜鸡用的是Maven项目,原先项目运行啥的没问题,换了svn后原先的逆向工程啥的没改,服务器启动也没有报错,可登陆localhost还是404.。。

导入Myeclipse的项目启动了,登录网页也打开了,但就是登录不上去,也没有错误提示

![图片说明](https://img-ask.csdn.net/upload/201512/23/1450841922_189992.png) 启动tomcat后,在页面登录,没有任何错误提示,点击一下登录按钮,页面刷新一下,就是这样

jsp中连接跳转丢失项目名

jsp为: ``` <p><a href="web/wechat/view/index.html">index</a></p> ``` 点击index后,跳转地址为 ``` http://localhost:8080/web/wechat/view/index.html ``` 少了项目名ddh,正确的如下: ``` http://localhost:8080/ddh/web/wechat/view/index.html ``` 修改application context,也无效

java web项目部署之后,运行几天会不正常,登录页面可以打开,但是进行任何数据库操作都会特别卡

java web项目部署之后,运行几天会不正常,登录页面可以打开,但是进行任何数据库操作都会特别卡,比如登录。 查了tomcat日志,宕机前只有一个MySQLSyntaxErrorException错误 大神分析一下 还有没有需要提供的东西?? 用的是java,tomcat7,springmvc,spring3.0,hibernate,mysql

java连接无法打开登陆所请求的数据库“ ” 登录失败

![图片说明](https://img-ask.csdn.net/upload/201508/01/1438402850_821393.png) public void doGet(HttpServletRequest req,HttpServletResponse res){ Connection ct=null; Statement sm=null; ResultSet rs=null; try{ System.out.println("1"); //接受用户和密码 String u=req.getParameter("usrename"); String p=req.getParameter("passwd"); //连接数据库 Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"); //得到连接 ct=DriverManager.getConnection("jdbc:microsoft:sqlserver://127.0.0.1:1433;databaseName=spdb","sa","123456"); //创建Statement sm=ct.createStatement(); rs=sm.executeQuery("select top 1 *from users where username='"+u +"'and passwd='"+p+"'"); //验证 if(rs.next()){ //将用户名和密码放入到session HttpSession hs=req.getSession(true); hs.setMaxInactiveInterval(30); hs.setAttribute("uname",u); //合法 res.sendRedirect("wel?uname="+u+"&pass="+p); }else{ //不合法 //跳转 res.sendRedirect("login"); } 帮我看一下,为什么会出现这种问题?

eclipse用jdbc连接不上数据库,Access denied for user 'root'@'localhost' (using password: YES),但我账号密码是对的

用的书上的源码,运行的时候能打开jsp页面,再跳转就显示jdbc连接打不开 我保证我的账号密码是正确的,在cmd上能登陆上mysql 未知错误: org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES)) 错误内容: org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES))at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:305)at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:374)at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:474)at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:289)at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)at com.sun.proxy.$Proxy31.login(Unknown Source)at com.controller.admin.AdminController.login(AdminController.java:22)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:871)at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:777)at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:881)at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:855)at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)at java.lang.Thread.run(Unknown Source) Caused by: java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES))at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2327)at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2056)at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:262)... 51 more Caused by: java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:873)at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:4420)at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1278)at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2188)at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2219)at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2014)at com.mysql.jdbc.ConnectionImpl.(ConnectionImpl.java:776)at com.mysql.jdbc.JDBC4Connection.(JDBC4Connection.java:47)at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)at java.lang.reflect.Constructor.newInstance(Unknown Source)at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:260)at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2337)at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2323)... 54 more

用SSM做登录的时候报了500的错误,跪求大神解决

SEVERE: Servlet.service() for servlet [springMVC] in context with path [/Apple] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.cj.jdbc.Driver' ### The error may exist in file [D:\Users\Administrator\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Apple\WEB-INF\classes\com\jc\mapper\UserMapper.xml] ### The error may involve com.jc.dao.UserDao.getRow ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.mysql.cj.jdbc.Driver'] with root cause java.lang.UnsupportedClassVersionError: com/mysql/cj/jdbc/Driver : Unsupported major.minor version 52.0 (unable to load class com.mysql.cj.jdbc.Driver) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2961) at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1210) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1690) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1415) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111) at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77) at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:81) at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:67) at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:315) at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:75) at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:61) at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:303) at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:154) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:102) at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:82) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:120) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:113) at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:73) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358) at $Proxy11.selectOne(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:163) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:69) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53) at $Proxy12.getRow(Unknown Source) at com.jc.service.UserService.login(UserService.java:19) at com.jc.controller.UserController.login(UserController.java:25) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:215) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:781) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:721) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868) at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)

求助。maven项目启动报错,网页localhost拒绝访问

求大神解决! 运行Maven项目之后(tomcat:run),在网页上localhost拒绝访问。然后用tomcat7运行依旧不行。 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.bos.dao.UserDao com.bos.service.impl.UserServiceImpl.userDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDaoImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Unable to open JDBC connection for schema management target at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:839) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:538) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) 八月 21, 2017 10:50:01 下午 org.apache.catalina.core.StandardContext startInternal 严重: Error listenerStart 八月 21, 2017 10:50:01 下午 org.apache.catalina.core.StandardContext startInternal 严重: Context [/bos] startup failed due to previous errors 八月 21, 2017 10:50:01 下午 org.apache.catalina.core.ApplicationContext log 信息: Closing Spring root WebApplicationContext 八月 21, 2017 10:50:01 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc 严重: The web application [/bos] registered the JDBC driver [com.mysql.fabric.jdbc.FabricMySQLDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 八月 21, 2017 10:50:01 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc 严重: The web application [/bos] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 八月 21, 2017 10:50:01 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/bos] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. 八月 21, 2017 10:50:01 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/bos] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#0] but has failed to stop it. This is very likely to create a memory leak. 八月 21, 2017 10:50:01 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/bos] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#1] but has failed to stop it. This is very likely to create a memory leak. 八月 21, 2017 10:50:01 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/bos] appears to have started a thread named [com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread-#2] but has failed to stop it. This is very likely to create a memory leak. 八月 21, 2017 10:50:01 下午 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads 严重: The web application [/bos] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. 八月 21, 2017 10:50:01 下午 org.apache.coyote.AbstractProtocol start 信息: Starting ProtocolHandler ["http-bio-8888"]

急求,请问如何实现两台电脑在在局域网内,实现javaweb项目间的数据交互

急求,请问如何实现两台电脑在在局域网内,一台电脑上javawbe客户端项目和另外一台电脑的上javaweb服务端实现数据交互--求大佬详细解答

Java代码自动生成图片验证码时图片无法加载的问题

## 求指教验证码图片无法加载是什么问题 ![如图所示](https://img-ask.csdn.net/upload/201907/17/1563352350_803951.png) ![图片说明](https://img-ask.csdn.net/upload/201907/18/1563411474_745017.png) 具体源代码请访问 [github代码连接]( https://github.com/Haven7/jude-Java-Springboot "") 片段代码如下: **login.html** ``` <!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <title>后台登录-进销存管理系统</title> <meta name="author" content="DeathGhost" /> <link rel="stylesheet" type="text/css" href="static/css/style.css" /> <style> body{height:100%; background: #16a085; overflow:hidden;} canvas{z-index:-1;position:absolute;} .black_overlay{ display: none; position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; z-index:1001; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80); } .white_content { display: none; position: absolute; top: 25%; left: 35%; width: 25%; height: 15%; padding: 16px; border: solid black; background-color: white; z-index:1002; overflow: auto; } </style> <script src="static/js/jquery.js"></script> <script src="static/js/verifyCode.js"></script> <script src="static/js/Particleground.js"></script> <script> $(document).ready(function() { //粒子背景特效 $('body').particleground({ dotColor: '#16a085', lineColor: '#5cbdaa' }); $("#loginBtn").click(function(){ $.post("/user/login",{userName:$("#userName").val(),password:$("#password").val(),imageCode:$("#imageCode").val()},function(result){ if(result.success){ if(result.roleSize==1){ var roleId=result.roleList[0].id; $.post("/user/saveRole",{roleId:roleId},function(result){ if(result.success){ window.location.href="/main.html"; } }); }else{ $("#roleList").empty(); var roles=result.roleList; for(var i=0;i<roles.length;i++){ if(i==0){ $("#roleList").append("<input type='radio' checked=true name='role' value='"+roles[i].id+"'/>"+roles[i].name+"&nbsp;&nbsp;") }else{ $("#roleList").append("<input type='radio' name='role' value='"+roles[i].id+"'/>"+roles[i].name+"&nbsp;&nbsp;") } } document.getElementById('light').style.display='block'; document.getElementById('fade').style.display='block'; } }else{ alert(result.errorInfo); } }); }); }); function saveRole(){ var roleId=$("input[name='role']:checked").val(); $.post("/user/saveRole",{roleId:roleId},function(result){ if(result.success){ window.location.href="/main.html"; } }); } </script> </head> <body> <dl class="admin_login"> <dt> <strong>进销存管理系统</strong> <em>Lnvoicing Management System</em> </dt> <dd class="user_icon"> <input type="text" id="userName" placeholder="账号" class="login_txtbx"/> </dd> <dd class="pwd_icon"> <input type="password" id="password" placeholder="密码" class="login_txtbx"/> </dd> <dd class="val_icon"> <div class="checkcode"> <input type="text" id="imageCode" name="imageCode" placeholder="验证码" maxlength="4" class="login_txtbx"> <img id="imgObj" title="看不清,换一张" src="/drawImage" onclick="changeImg()" /> </div> </dd> <dd> <input type="button" id="loginBtn" value="立即登陆" class="submit_btn"/> </dd> <dd> <p>© 2012-2018 </p> <p><a href="" target="_blank"> </a></p> </dd> </dl> <div id="light" class="white_content"> <p>请选择一个角色登录系统</p> <br/> <div id="roleList"> </div> <br/> <input type="button" value="提交" onclick="saveRole()"/> </div> <div id="fade" class="black_overlay"> </div> </body> </html> ``` **verifyCode.js** ``` //点击换一张验证码 function changeImg() { var imgSrc = $("#imgObj"); var src = imgSrc.attr("src"); imgSrc.attr("src",chgUrl(src)); $("#info").html(""); } //时间戳 //为了使每次生成图片不一致,即不让浏览器读缓存,所以需要加上时间戳 function chgUrl(url) { var timestamp = (new Date()).valueOf(); url = url.substring(0, 17); if ((url.indexOf("&") >= 0)) { url = url + "×tamp=" + timestamp; } else { url = url + "?timestamp=" + timestamp; } return url; } //验证码验证 function isRightCode() { var code = $("#veryCode").attr("value"); //alert(code); code = "c=" + code; $.ajax( { type : "POST", url : "ResultServlet", data : code, success : callback }); } //验证以后处理提交信息或错误信息 function callback(data) { if(data.toString()==1) { $("#info").html("xw素材网提醒您:成功了!"); return; }else { $("#info").html(data); return; } } ``` **DrawImageController.java** ``` package com.jude.controller; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.util.Random; import javax.imageio.ImageIO; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.kafka.KafkaProperties; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; /** * 生成验证码 * @author jude * */ @Controller public class DrawImageController { public static final int WIDTH = 120; public static final int HEIGHT = 30; /** * 生成图片 * @param request * @param response */ @RequestMapping("/drawImage") public void drawImage(HttpServletRequest request, HttpServletResponse response)throws Exception{ request.setCharacterEncoding("utf-8"); response.setContentType("text/html;charset=utf-8"); // 创建缓存 BufferedImage bi = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB); // 获得画布 Graphics g = bi.getGraphics(); // 设置背影色 setBackGround(g); // 设置边框 setBorder(g); // 画干扰线 drawRandomLine(g); // 写随机数 String random = drawRandomNum((Graphics2D) g); // 将随机汉字存在session中 request.getSession().setAttribute("checkcode", random); // 将图形写给浏览器 response.setContentType("image/jpeg"); // 发头控制浏览器不要缓存 response.setDateHeader("expries", -1); response.setHeader("Cache-Control", "no-cache"); response.setHeader("Pragma", "no-cache"); // 将图片写给浏览器 response.setHeader("Cache-Control", "no-store, no-cache"); response.setContentType("image/jpeg"); ImageIO.write(bi, "jpg", response.getOutputStream()); } /** * 设置背景色 * * @param g */ private void setBackGround(Graphics g) { // 设置颜色 g.setColor(new Color(22, 160, 133)); // 填充区域 g.fillRect(0, 0, WIDTH, HEIGHT); } /** * 设置边框 * * @param g */ private void setBorder(Graphics g) { // 设置边框颜色 g.setColor(new Color(22, 160, 133)); // 边框区域 g.drawRect(1, 1, WIDTH - 2, HEIGHT - 2); } /** * 画随机线条 * * @param g */ private void drawRandomLine(Graphics g) { // 设置颜色 g.setColor(Color.WHITE); // 设置线条个数并画线 for (int i = 0; i < 5; i++) { int x1 = new Random().nextInt(WIDTH); int y1 = new Random().nextInt(HEIGHT); int x2 = new Random().nextInt(WIDTH); int y2 = new Random().nextInt(HEIGHT); g.drawLine(x1, y1, x2, y2); } } /** * 画随机汉字 * * @param g * @return */ private String drawRandomNum(Graphics2D g) { StringBuffer sb = new StringBuffer(); // 设置颜色 g.setColor(Color.WHITE); // 设置字体 g.setFont(new Font("宋体", Font.BOLD, 20)); // 准备常用汉字集 String base = "\u7684\u4e00\u4e86\u662f\u6211\u4e0d\u5728\u4eba\u4eec\u6709\u6765\u4ed6\u8fd9\u4e0a\u7740\u4e2a\u5730\u5230\u5927\u91cc\u8bf4\u5c31\u53bb\u5b50\u5f97\u4e5f\u548c\u90a3\u8981\u4e0b\u770b\u5929\u65f6\u8fc7\u51fa\u5c0f\u4e48\u8d77\u4f60\u90fd\u628a\u597d\u8fd8\u591a\u6ca1\u4e3a\u53c8\u53ef\u5bb6\u5b66\u53ea\u4ee5\u4e3b\u4f1a\u6837\u5e74\u60f3\u751f\u540c\u8001\u4e2d\u5341\u4ece\u81ea\u9762\u524d\u5934\u9053\u5b83\u540e\u7136\u8d70\u5f88\u50cf\u89c1\u4e24\u7528\u5979\u56fd\u52a8\u8fdb\u6210\u56de\u4ec0\u8fb9\u4f5c\u5bf9\u5f00\u800c\u5df1\u4e9b\u73b0\u5c71\u6c11\u5019\u7ecf\u53d1\u5de5\u5411\u4e8b\u547d\u7ed9\u957f\u6c34\u51e0\u4e49\u4e09\u58f0\u4e8e\u9ad8\u624b\u77e5\u7406\u773c\u5fd7\u70b9\u5fc3\u6218\u4e8c\u95ee\u4f46\u8eab\u65b9\u5b9e\u5403\u505a\u53eb\u5f53\u4f4f\u542c\u9769\u6253\u5462\u771f\u5168\u624d\u56db\u5df2\u6240\u654c\u4e4b\u6700\u5149\u4ea7\u60c5\u8def\u5206\u603b\u6761\u767d\u8bdd\u4e1c\u5e2d\u6b21\u4eb2\u5982\u88ab\u82b1\u53e3\u653e\u513f\u5e38\u6c14\u4e94\u7b2c\u4f7f\u5199\u519b\u5427\u6587\u8fd0\u518d\u679c\u600e\u5b9a\u8bb8\u5feb\u660e\u884c\u56e0\u522b\u98de\u5916\u6811\u7269\u6d3b\u90e8\u95e8\u65e0\u5f80\u8239\u671b\u65b0\u5e26\u961f\u5148\u529b\u5b8c\u5374\u7ad9\u4ee3\u5458\u673a\u66f4\u4e5d\u60a8\u6bcf\u98ce\u7ea7\u8ddf\u7b11\u554a\u5b69\u4e07\u5c11\u76f4\u610f\u591c\u6bd4\u9636\u8fde\u8f66\u91cd\u4fbf\u6597\u9a6c\u54ea\u5316\u592a\u6307\u53d8\u793e\u4f3c\u58eb\u8005\u5e72\u77f3\u6ee1\u65e5\u51b3\u767e\u539f\u62ff\u7fa4\u7a76\u5404\u516d\u672c\u601d\u89e3\u7acb\u6cb3\u6751\u516b\u96be\u65e9\u8bba\u5417\u6839\u5171\u8ba9\u76f8\u7814\u4eca\u5176\u4e66\u5750\u63a5\u5e94\u5173\u4fe1\u89c9\u6b65\u53cd\u5904\u8bb0\u5c06\u5343\u627e\u4e89\u9886\u6216\u5e08\u7ed3\u5757\u8dd1\u8c01\u8349\u8d8a\u5b57\u52a0\u811a\u7d27\u7231\u7b49\u4e60\u9635\u6015\u6708\u9752\u534a\u706b\u6cd5\u9898\u5efa\u8d76\u4f4d\u5531\u6d77\u4e03\u5973\u4efb\u4ef6\u611f\u51c6\u5f20\u56e2\u5c4b\u79bb\u8272\u8138\u7247\u79d1\u5012\u775b\u5229\u4e16\u521a\u4e14\u7531\u9001\u5207\u661f\u5bfc\u665a\u8868\u591f\u6574\u8ba4\u54cd\u96ea\u6d41\u672a\u573a\u8be5\u5e76\u5e95\u6df1\u523b\u5e73\u4f1f\u5fd9\u63d0\u786e\u8fd1\u4eae\u8f7b\u8bb2\u519c\u53e4\u9ed1\u544a\u754c\u62c9\u540d\u5440\u571f\u6e05\u9633\u7167\u529e\u53f2\u6539\u5386\u8f6c\u753b\u9020\u5634\u6b64\u6cbb\u5317\u5fc5\u670d\u96e8\u7a7f\u5185\u8bc6\u9a8c\u4f20\u4e1a\u83dc\u722c\u7761\u5174\u5f62\u91cf\u54b1\u89c2\u82e6\u4f53\u4f17\u901a\u51b2\u5408\u7834\u53cb\u5ea6\u672f\u996d\u516c\u65c1\u623f\u6781\u5357\u67aa\u8bfb\u6c99\u5c81\u7ebf\u91ce\u575a\u7a7a\u6536\u7b97\u81f3\u653f\u57ce\u52b3\u843d\u94b1\u7279\u56f4\u5f1f\u80dc\u6559\u70ed\u5c55\u5305\u6b4c\u7c7b\u6e10\u5f3a\u6570\u4e61\u547c\u6027\u97f3\u7b54\u54e5\u9645\u65e7\u795e\u5ea7\u7ae0\u5e2e\u5566\u53d7\u7cfb\u4ee4\u8df3\u975e\u4f55\u725b\u53d6\u5165\u5cb8\u6562\u6389\u5ffd\u79cd\u88c5\u9876\u6025\u6797\u505c\u606f\u53e5\u533a\u8863\u822c\u62a5\u53f6\u538b\u6162\u53d4\u80cc\u7ec6"; int x = 5; // 控制字数 for (int i = 0; i < 4; i++) { // 设置字体旋转角度 int degree = new Random().nextInt() % 30; // 截取汉字 String ch = base.charAt(new Random().nextInt(base.length())) + ""; sb.append(ch); // 正向角度 g.rotate(degree * Math.PI / 180, x, 20); g.drawString(ch, x, 20); // 反向角度 g.rotate(-degree * Math.PI / 180, x, 20); x += 30; } System.out.println(sb.toString()); return sb.toString(); } } ```

登陆界面的用户名id怎么传到后面让其他页面可以用?我改的不起作用

login.jsp <%@page import="org.apache.tomcat.util.descriptor.web.LoginConfig"%> <%@page import="com.sun.java.swing.plaf.windows.resources.windows"%> <%@page import="javax.servlet.jsp.tagext.TryCatchFinally"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="java.sql.*" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>用户登录</title> </head> <body> <!-- 统一编码 --> <% request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); %> <!-- 连接数据库 --> <%! String driver="com.mysql.jdbc.Driver"; int i=0;//测试数据库是否存在该用户 Connection conn =null; PreparedStatement ps=null; ResultSet rs=null; String url="jdbc:mysql://127.0.0.1:3306/Hit_DB"; String user="root"; String password="12345678"; String sql="select user_name,user_password from user_table"; %> <!-- 按六步法完成业务处理 --> <% try{ String user_name1=request.getParameter("username"); String user_password1=request.getParameter("password11"); /* session.setAttribute("uname",user_name1); */ String user_name2=null; String user_password2=null; Class.forName(driver); conn=DriverManager.getConnection(url, user, password); ps=(PreparedStatement)conn.prepareStatement(sql); rs=ps.executeQuery(); while(rs.next()){ user_name2=rs.getString(1); user_password2=rs.getString(2); if(user_name1.equals(user_name2)&&user_password1.equals(user_password2)){ request.getRequestDispatcher("index.html").forward(request,response); i=1; } } if(i==0){ out.println("<script>alert('请重新登录!');window.history.back(-1);</script>"); } i=0; String username = request.getParameter("user_name1"); }catch(SQLException e){ out.print("数据库异常!"); }finally{ } %> <%-- <% String name=request.getParameter("user_name1"); session.setAttribute("uname", name); %> --%> <!-- 关闭对象 --> <% if(rs!=null){ rs.close(); } if(ps!=null){ ps.close(); } if(conn!=null){ conn.close(); } %> </body> </html> person.jsp <%@page import="com.sun.xml.internal.txw2.Document"%> <%@page import="javax.websocket.Session"%> <%@page import="org.apache.catalina.connector.Request"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@page import="java.sql.*" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" /> <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" /> <link rel="stylesheet" type="text/css" href="css/person.css" /> <title>个人页面</title> </head> <body> <%! //定义全局变量 String driver="com.mysql.jdbc.Driver"; String url="jdbc:mysql://127.0.0.1:3306/Hit_DB"; String user="root"; String password="12345678"; /* String username=null; */ String sql="select * from user_table where user_name=?"; Connection conn=null; PreparedStatement ps=null; ResultSet rs=null; %> <% //设置编码,防止乱码现象 request.setCharacterEncoding("UTF-8"); response.setCharacterEncoding("UTF-8"); %> <% try{ /* String uname=(String)session.getAttribute("uname"); */ String uname = request.getParameter("username"); /* String name=new String(session.getAttribute("name").toString().getBytes("ISO-8859-1"),"UTF-8"); */ Class.forName(driver); conn=DriverManager.getConnection(url,user,password); ps=conn.prepareStatement(sql); ps.setString(1,uname); rs=ps.executeQuery(); /* String users=request.getParameter("username"); */ }catch(SQLException e){ out.print("无法查询!"); } %> <!--导航栏--> <nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <a href="index.html" class="navbar-brand logo"><img src="images/logo1.png" /></a> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="collapse navbar-collapse" id="navbar-collapse"> <ul class="nav navbar-nav navbar-right"> <li class="nav-li"> <a href="index.html" class="active"><span class="glyphicon glyphicon-home"></span> 首页</a> </li> <li class="nav-li"> <a href="information.html"><span class="glyphicon glyphicon-list"></span> 资讯</a> </li> <li class="nav-li"> <a href="case.html"><span class="glyphicon glyphicon-fire"></span>打卡小明星</a> </li> <li class="nav-li"> <a href="about.html"><span class="glyphicon glyphicon-question-sign"></span> 关于</a> </li> <li> <div class="dropdown hidden-xs"> <img src="images/avatar.jpg" class="dropdown-toggle avatar" data-toggle="dropdown"> <ul class="dropdown-menu"> <li><a href="person.html">个人中心</a></li> <li><a href="CircleOfFriends.html">朋友圈</a></li> <li><a href="massage.html">消息</a></li> <li><a href="published-topics.html">发表</a></li> <li><a href="#">设置</a></li> <li class="divider"></li> <li><a href="xxx">退出</a></li> </ul> </div> </li> </ul> </div> </div> </nav> <!----> <div class="head"> <div class="container"> <div class="row"> <div class="col-md-2 hidden-xs"> <img src="images/avatar.jpg" class="img-circle head-portrait" /> </div> <div class="col-md-10 head-num"> <div class="info"> <strong class="username"> <% sql="select user_nickname,user_sex,user_email from user_table where user_name=?"; conn=null; ps=null; rs=null; %> <% try{ String uname = request.getParameter("username"); conn=DriverManager.getConnection(url,user,password); ps=conn.prepareStatement(sql); ps.setString(1,uname); rs=ps.executeQuery(); while(rs.next()){ String nick=rs.getString("user_nickname"); out.print(nick); } /* String users=request.getParameter("username"); */ }catch(SQLException e){ out.print("无法查询!"); } %> </strong> </div> login.jsp是跳转到index.html这个主界面的,然后从主界面跳转到person.jsp个人界面,个人界面从数据库传数据要用到登陆界面的用户名。。。。

Jsp+JavaBean+MySql实现登陆及增删改查出错。The value for the useBean class attribute bean.Sql

Jsp+JavaBean+MySql实现登陆及增删改查出错。The value for the useBean class attribute bean.SqlConn is invalid. 运行环境:Tomcat6.0+jdk1.6+MyEclipse6.0 报错信息: type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: /ADMS/WebRoot/add.jsp(2,0) The value for the useBean class attribute bean.SqlConn is invalid. org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148) org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1200) org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1155) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392) org.apache.jasper.compiler.Node$Root.accept(Node.java:489) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336) org.apache.jasper.compiler.Generator.generate(Generator.java:3394) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:210) org.apache.jasper.compiler.Compiler.compile(Compiler.java:306) org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) org.apache.jasper.compiler.Compiler.compile(Compiler.java:273) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) note The full stack trace of the root cause is available in the Apache Tomcat/6.0.10 logs. 我的代码 1.SqlConn.java package bean; import java.sql.*; public class SqlConn { private String url = "jdbc:mysql://localhost:3036/adms"; private String user = "root"; private String password = "root"; private Connection conn = null; private Statement stmt = null; private ResultSet rs = null; public SqlConn(){ try{ Class.forName("com.mysql.jdbc.Driver"); } catch(java.lang.ClassNotFoundException e){ System.err.println("SqlConn():"+e.getMessage()); } } public ResultSet executeQuery(String sql){ try{ conn = DriverManager.getConnection(url,user,password); stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY); rs = stmt.executeQuery(sql); }catch(SQLException ex){ System.err.println("SqlConn.executeQuery:"+ex.getMessage()); } return rs; } public void executeUpdate(String sql){ try{ conn = DriverManager.getConnection(url,user,password); stmt = conn.createStatement(); stmt.executeUpdate(sql); stmt.close(); conn.close(); }catch(SQLException ex){ System.err.println("SqlConn.executeUpdate:"+ex.getMessage()); } } public void closeStmt(){ try{ stmt.close(); }catch(SQLException e){ e.printStackTrace(); } } public void closeConn(){ try{ conn.close(); }catch(SQLException e){ e.printStackTrace(); } } public static void main(String[] args) { // TODO Auto-generated method stub } } 2.login.jsp <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%--使用SqlConn.class--%> <jsp:useBean id="sqlbean" scope="page" class="bean.SqlConn"/> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>My JSP 'login.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head> <body> <form name="form1" action="loginto.jsp" method="post"> <table width="225" border="1" align="center"> <tbody> <tr> <td>用户名</td> <td><input type="text" name="username"> </td> </tr> <tr> <td>密码 </td> <td><input type="password" name="password"></td> </tr> <tr> <td colspan="2" align="center"> <input type="radio" checked="checked" value="1" name="role">用户 &nbsp;&nbsp;&nbsp; <input type="radio" value="0" name="role">管理员 </td> </tr> <tr> <td>&nbsp;</td> <td><input type="submit" value="登陆" name="login"> &nbsp;&nbsp; <input type="reset" value="重置" name="reset"> </td> </tr> </tbody> </table> </form> </body> </html> 3.loginto.jsp <%@ page language="java" import="java.sql.*" pageEncoding="UTF-8"%> <jsp:useBean id="sqlbean" scope="page" class="bean.SqlConn"/> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>My JSP 'loginto.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head> <body> <% String username = request.getParameter("username").trim(); String password = request.getParameter("password").trim(); String role = request.getParameter("role").trim(); try{ if(role.equals("0")) { String sql = "select * from admin where admin_id='"+username+"'and admin_psw='"+password+"'"; ResultSet rs = sqlbean.executeQuery(sql); if(rs.next()) response.sendRedirect("adms.jsp"); else out.println("错误的用户名或密码!"); } else if(role.equals("1")) { String sql = "select * from user where user_id='"+username+"'and user_psw='"+password+"'"; ResultSet rs = sqlbean.executeQuery(sql); if(rs.next()) out.println("您好,"+username); else out.println("错误的用户名或密码!"); } }catch(Exception ee){ ee.printStackTrace(); } %> </body> </html> 还有添加,删除,修改,查找等jsp页面。 我用JSP页面直接连接就能运行,没有错。只要是有JavaBean,就会报错。希望大家多多指教。 这个问题出现好久了,不仅这一个项目有这样的问题,所有的导入和新建的web project 只要有JavaBean都会有这样的错误。 搞不清是什么原因。数据库是SQLServer2000的时候也是这样的错误。

JSP+servlet实现网页数据插入mysql问题求解

本意是将网页上表格数据插入到mysql的表中 数据获取和类的构造 L_datainsert.java package a; import java.io.IOException; import java.util.Date; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public abstract class L_datainsert implements javax.servlet.Servlet { public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException{ response.setContentType("text/html"); request.setCharacterEncoding("UTF-8"); String[] thi=request.getParameterValues("thi"); String[] the=request.getParameterValues("the"); String[] fl=request.getParameterValues("fl"); String[] chu=request.getParameterValues("chu"); String[] hh=request.getParameterValues("hh"); for(int n=0;n<10;n++){ Hs hs = new Hs(); hs.setThi(Double.parseDouble(thi[n])); hs.setThe(Double.parseDouble(the[n])); hs.setFl(Double.parseDouble(fl[n])); hs.setChu(Double.parseDouble(chu[n])); hs.setHh(Double.parseDouble(hh[n])); Hsinsert db = new Hsinsert(); boolean canLogin = db.addHs(hs);} } } class Hs { private double thi; private double the; private double fl; private double chu; private double hh; public Hs(double i, double e, double l,double u, double h) { thi = i; the = e; fl = l; chu = u; hh = h; } public Hs() { } public void setThi(double thi){ this.thi = thi; } public double getThi(){ return thi; } public void setThe(double the){ this.the = the; } public double getThe(){ return the; } public void setFl(double fl){ this.fl = fl; } public double getFl(){ return fl; } public void setChu(double chu){ this.chu = chu; } public double getChu(){ return chu; } public void setHh(double hh){ this.hh = hh; } public double getHh(){ return hh; } } 插入方法实现:Hsinsert.java package a; import java.sql.*; public class Hsinsert { boolean bInited = false; //加载驱动 public void initJDBC() throws ClassNotFoundException { //加载MYSQL JDBC驱动程序 Class.forName("com.mysql.jdbc.Driver"); bInited = true; System.out.println("Success loading Mysql Driver!"); } public Connection getConnection() throws ClassNotFoundException, SQLException{ if(!bInited){ initJDBC(); } //连接URL为 jdbc:mysql//服务器地址/数据库名 //后面的2个参数分别是登陆用户名和密码 Connection conn = DriverManager.getConnection( "jdbc:mysql://localhost:3306/login?characterEncoding=utf8&useSSL=true","root",""); return conn; } public boolean addHs(Hs hs){ boolean returnValue = false; try{ Class.forName("com.mysql.jdbc.Driver");//加载数据库驱动,注册到驱动管理器 Connection conn = DriverManager.getConnection( "jdbc:mysql://localhost:3306/login?characterEncoding=utf8&useSSL=true","root",""); //创建connection连接, String sql="insert into hs(thi,the,fl,chu,hh) values(?,?,?,?,?)"; //添加图书信息的sql语句 PreparedStatement ps=conn.prepareStatement(sql); //获取PreparedStatement ps.setDouble(2,hs.getThi());//对sql语句中的第1个参数赋值 ps.setDouble(3,hs.getThe());//对sql语句中的第2个参数赋值 ps.setDouble(4,hs.getFl());//对sql语句中的第3个参数赋值 ps.setDouble(5,hs.getChu());//对sql语句中的第4个参数赋值 ps.setDouble(6,hs.getHh()); int row=ps.executeUpdate();//执行更新操作,返回所影响的行数 if(row>0){ returnValue = true; } ps.close(); conn.close(); }catch (ClassNotFoundException e) { e.printStackTrace(); }catch (SQLException e) { e.printStackTrace(); } return returnValue; } } 但是运行没办法实现 弹出![图片说明](https://img-ask.csdn.net/upload/201706/01/1496308529_290964.png) 是因为我没有设置好xml文件吗 还是别的原因?我的xml文件内容如下:![图片说明](https://img-ask.csdn.net/upload/201706/01/1496312692_144002.png) 工程内容截图为:![图片说明](https://img-ask.csdn.net/upload/201706/01/1496312785_296623.png) 我重新配置了xml文件:![图片说明](https://img-ask.csdn.net/upload/201706/02/1496367553_524699.png) 但还是没好,运行错误为![图片说明](https://img-ask.csdn.net/upload/201706/02/1496367922_913258.png) ![图片说明](https://img-ask.csdn.net/upload/201706/02/1496367937_625333.png)

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

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

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

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

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

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

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

和黑客斗争的 6 天!

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

点沙成金:英特尔芯片制造全过程揭密

“亚马逊丛林里的蝴蝶扇动几下翅膀就可能引起两周后美国德州的一次飓风……” 这句人人皆知的话最初用来描述非线性系统中微小参数的变化所引起的系统极大变化。 而在更长的时间尺度内,我们所生活的这个世界就是这样一个异常复杂的非线性系统…… 水泥、穹顶、透视——关于时间与技艺的蝴蝶效应 公元前3000年,古埃及人将尼罗河中挖出的泥浆与纳特龙盐湖中的矿物盐混合,再掺入煅烧石灰石制成的石灰,由此得来了人...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

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

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

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

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

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

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

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

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

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

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

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

优雅的替换if-else语句

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

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

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

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

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

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

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

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

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

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

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

面试:第十六章:Java中级开发(16k)

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

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

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

你打算用Java 8一辈子都不打算升级到Java 14,真香

我们程序员应该抱着尝鲜、猎奇的心态,否则就容易固步自封,技术停滞不前。

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

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

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

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

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

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

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

《经典算法案例》01-08:如何使用质数设计扫雷(Minesweeper)游戏

我们都玩过Windows操作系统中的经典游戏扫雷(Minesweeper),如果把质数当作一颗雷,那么,表格中红色的数字哪些是雷(质数)?您能找出多少个呢?文中用列表的方式罗列了10000以内的自然数、质数(素数),6的倍数等,方便大家观察质数的分布规律及特性,以便对算法求解有指导意义。另外,判断质数是初学算法,理解算法重要性的一个非常好的案例。

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

正确选择比瞎努力更重要!

一文带你入门Java Stream流,太强了

两个星期以前,就有读者强烈要求我写一篇 Java Stream 流的文章,我说市面上不是已经有很多了吗,结果你猜他怎么说:“就想看你写的啊!”你看你看,多么苍白的喜欢啊。那就“勉为其难”写一篇吧,嘻嘻。 单从“Stream”这个单词上来看,它似乎和 java.io 包下的 InputStream 和 OutputStream 有些关系。实际上呢,没毛关系。Java 8 新增的 Stream 是为...

都前后端分离了,咱就别做页面跳转了!统统 JSON 交互

文章目录1. 无状态登录1.1 什么是有状态1.2 什么是无状态1.3 如何实现无状态1.4 各自优缺点2. 登录交互2.1 前后端分离的数据交互2.2 登录成功2.3 登录失败3. 未认证处理方案4. 注销登录 这是本系列的第四篇,有小伙伴找不到之前文章,松哥给大家列一个索引出来: 挖一个大坑,Spring Security 开搞! 松哥手把手带你入门 Spring Security,别再问密...

立即提问
相关内容推荐