九儿七七
2015-11-26 11:36
为什么运行时查询学生界面时查询不到信息呢,数据库中也有数据。
这里面不好说,反正就是在 访问数据库的那一层中输出 你从前台带进来的查询条件(为什么输出的原因是因为我担心参数可能就丢失了,带入数据库里面当然就是查不出结果的)要是有输出,就看sql(需要校验sql能否成功执行)语句执行,返回的结果有没有,如果要就是页面展示以及servlet中可能没处理好导致页面取不到数据
居然我也是同样的问题
2015-12-2 9:09:28 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: E:\MyEclipse 8.5\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;D:\Tomcat 6.0\bin
2015-12-2 9:09:28 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2015-12-2 9:09:28 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 443 ms
2015-12-2 9:09:28 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2015-12-2 9:09:28 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.18
log4j:WARN No appenders could be found for logger (com.opensymphony.xwork2.config.providers.XmlConfigurationProvider).
log4j:WARN Please initialize the log4j system properly.
2015-12-2 9:09:33 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-default.xml]
2015-12-2 9:09:33 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-plugin.xml]
2015-12-2 9:09:33 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts.xml]
log4j:WARN No appenders could be found for logger (freemarker.cache).
log4j:WARN Please initialize the log4j system properly.
2015-12-2 9:09:37 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2015-12-2 9:09:37 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2015-12-2 9:09:37 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/47 config=null
2015-12-2 9:09:37 org.apache.catalina.startup.Catalina start
信息: Server startup in 8641 ms
查询的时候控制台输出什么?你贴出来 我看下
2015-11-26 16:41:53 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: E:\MyEclipse 8.5\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;D:\Tomcat 6.0\bin
2015-11-26 16:41:53 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2015-11-26 16:41:53 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 663 ms
2015-11-26 16:41:53 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2015-11-26 16:41:53 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.18
log4j:WARN No appenders could be found for logger (com.opensymphony.xwork2.config.providers.XmlConfigurationProvider).
log4j:WARN Please initialize the log4j system properly.
2015-11-26 16:41:59 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-default.xml]
2015-11-26 16:41:59 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts-plugin.xml]
2015-11-26 16:41:59 com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
信息: Parsing configuration file [struts.xml]
log4j:WARN No appenders could be found for logger (freemarker.cache).
log4j:WARN Please initialize the log4j system properly.
2015-11-26 16:42:05 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2015-11-26 16:42:05 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2015-11-26 16:42:05 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/60 config=null
2015-11-26 16:42:05 org.apache.catalina.startup.Catalina start
信息: Server startup in 12044 ms
Hibernate:
select
users0_.uid as uid1_1_,
users0_.username as username2_1_,
users0_.password as password3_1_
from
hello_users users0_
where
users0_.username=?
and users0_.password=?
有可能是你的查询界面的表单代码name属性值去javaBean中封装的值不一致,或者说你的查询方法的sql语句不正确,又或者数据库名字写错了吧。
也可以在持久层做一个输出输出 查询条件以及结果看控制台输出
使用Struts2+Hibernate开发学生信息管理功能
80701 学习 · 754 问题
相似问题