
JavaWeb
BrownWong
None
展开
-
My first Hibernate app
I created my first Hibernate app just now. It saved some variables to MySQL db.Here is my steps: 1.Create the java project 2.Add hibernate capabilities 3.Create the Persistent class 4.Creat原创 2015-09-04 14:12:40 · 521 阅读 · 0 评论 -
Demo(HTML+Ajax+Servlet)
Steps: 1.Create the “index.html” file in the WebRoot foldder. 2.Create “js” foldder in the WebRoot ,and then add “jquery” file. 3.Create the package of “controller”,and then create “AjaxController.j原创 2015-09-19 15:24:53 · 950 阅读 · 0 评论 -
关于中文乱码
对于html文件,使用GB2312编码方式: html文件头部添加下面行:< meta name="content-type" content="text/html; charset=GB2312">请确保文件属性中编码也设置为GB2312 对于jsp文件,使用utf-8编码: <%@page %>标签中添加:contentType="text/html; charset=UTF-8"原创 2016-04-18 15:23:57 · 372 阅读 · 0 评论 -
Note1
1.在配置servlet时,< url-pattern >的值要和form的action保持一致(并不意味着完全一样)。原创 2016-05-23 17:48:46 · 334 阅读 · 0 评论 -
Servlet中获取ServletContext(jsp中application)
jsp中的application对象是ServletContext的一个实例,在Servlet中,我们经常需要使用它。 package brown;import java.io.IOException;import javax.servlet.ServletConfig; import javax.servlet.ServletContext; import javax.servlet.Servle原创 2016-05-23 17:31:33 · 1888 阅读 · 0 评论 -
JavaWeb(jsp)连接mysql数据库
在JSP中使用JDBC驱动连接mysql数据库。 Step1: 下载mysql的Java连接程序** https://dev.mysql.com/downloads/connector/j/ Step2: 解压目录下的mysql-connector-java-5.0.24-bin.jar文件就是连接MySql数据库的纯Java驱动程序。将该驱动程序复制到Tomcat服务器原创 2016-05-18 08:20:14 · 15190 阅读 · 1 评论