J2ee开发常见问题及解决方法

1.Mysql连接数据库出现java/sql/SQLClientInfoException

解决:在eclipse中选择eclipse自带的jre即可。


2.struts2,hibernate,spring 出现No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here
解决:1.struts的action不应有任何关于事务的返回值,也就是getManager方法
2.正确配置spring的事务














3.struts2获取response

HttpServletResponse response = ServletActionContext.getResponse();
response.setContentType("text/plain "); //text/xml
PrintWriter pw = response.getWriter();
pw.print("true");


strus 配置(struts的action可以返回void的)




你可能感兴趣的:(java)