摘要: 本文使用的IDE是MyEclipse6.5,spring2和hibernate3.1根据向导就可以很容易的加入到应用中去,只有struts2需要手工的加入。下面我一步一步的帮大家整合struts2+spring2+hibernate3.1: 1.新建一Web Project:Project Name随便命名,这里填demo,J2EE Specification Level选择Java EE 5... 阅读全文
posted @ 2008-08-30 11:26 魔豆 阅读(1478) 评论(0) 推荐(0) 编辑
摘要: 普通的struts2配置文件一般是这么配置的: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> /page.jsp 这里的view是一个jsp页面,也可以改成是一个freemarker模板页面: Code highlighting pr... 阅读全文
posted @ 2008-08-28 17:46 魔豆 阅读(4570) 评论(0) 推荐(0) 编辑
摘要: 这篇文章的代码在上篇文章的基础之上,《JSP学习笔记(三十):freemarker入门例子》 把普通类Class1.java改为servlet类,Servlet1.java,并把原来的从输出到页面改为输出到文件。 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.... 阅读全文
posted @ 2008-08-28 14:30 魔豆 阅读(1909) 评论(2) 推荐(0) 编辑
摘要: 1.首先从官方下载freemarker的包,下载地址:http://freemarker.sourceforge.net/freemarkerdownload.html 2.把包lib/freemarker.jar拷贝到项目中 3.新建模板文件WEB-INF/templates/test.ftl,内容如下: Code highlighting produced by Actipro Cod... 阅读全文
posted @ 2008-08-28 11:39 魔豆 阅读(8537) 评论(1) 推荐(0) 编辑
摘要: 代码: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 阅读全文
posted @ 2008-08-28 10:18 魔豆 阅读(1671) 评论(0) 推荐(0) 编辑
摘要: 第一步 下载urlrewrite,官方下载地址:http://tuckey.org/urlrewrite/dist/urlrewritefilter-2.6.zip 第二步 解压缩文件,压缩包内文件copy到项目中(压缩包位置 -> 项目位置): urlrewrite-2.6.0-src/webapp/WEB-INF/lib/urlrewrite-2.6.0.jar -> WebRoot/WE... 阅读全文
posted @ 2008-08-27 23:21 魔豆 阅读(2663) 评论(0) 推荐(0) 编辑
摘要: 两种方式 1.使用配置文件validation 详细见:http://www.blogjava.net/supercrsky/articles/162769.html 2.使用Action中的validate方法 详细见: http://www.blogjava.net/supercrsky/articles/162872.html 阅读全文
posted @ 2008-08-25 11:30 魔豆 阅读(261) 评论(0) 推荐(0) 编辑
摘要: 1.建立UML文件:New->Other->UML->UML Model Repository 2.在类图上可以很容易的建立Package包,Interface接口,Class类等,然后在接口里定义方法,在类里定义属性或是类,鼠标指到接口或类上,可以快速的实现接口,或是继承类。 在实现接口的类上,右键Auto Implement Operations,快速实现接口的方法。 3.类图建好后,... 阅读全文
posted @ 2008-08-24 12:30 魔豆 阅读(1490) 评论(0) 推荐(0) 编辑
摘要: 步骤一 下载jar包,官方下载地址:http://logging.apache.org/log4j/1.2/download.html 其实很多包里都带了log4j,带的话,就不用额外下载了,比如struts2,spring等包里,用的实在是太广泛了。 步骤二 建立log4j.properties文件,最简单的内容如下: Code highlighting produced by Actip... 阅读全文
posted @ 2008-08-23 23:15 魔豆 阅读(2082) 评论(0) 推荐(0) 编辑
摘要: 利用MyEclipse可以很容易的根据数据库表生成Hibernate mapping file和实体类。 同时反过来,利用生成的Hibernate mapping file和实体类也可以生成数据库表,这样就可以免去部署项目时建立数据库表的过程,也可以利用这种方法从一种数据库导入到另一种数据库。 在使用前一定要确保Hibernate在应用中可以正常访问数据库。 自动生成只适用于数据库的表,数... 阅读全文
posted @ 2008-08-22 16:22 魔豆 阅读(1636) 评论(0) 推荐(0) 编辑
摘要: 原理是使用servlet的监听器,建立一个servlet类并且实现ServletContextListener接口: T1.java Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->package com.abc.test;import java.io... 阅读全文
posted @ 2008-08-21 10:44 魔豆 阅读(2018) 评论(0) 推荐(0) 编辑
摘要: servlet需要继承javax.servlet.http.HttpServlet类,添加一个servlet类 T1.java Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->package com.abc.test; import java.i... 阅读全文
posted @ 2008-08-21 08:25 魔豆 阅读(745) 评论(0) 推荐(0) 编辑
摘要: 情景一 research.HscOption 的内容为:很好;一般;差 我需要按";"用split分开,然后显示到一个中 在页面中实现: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 在action中实现: Code highlighti... 阅读全文
posted @ 2008-08-20 10:11 魔豆 阅读(1631) 评论(0) 推荐(0) 编辑
摘要: 一、 request对象struts2 action中访问:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->HttpServletRequest request = ServletActionContext.getRequest();Stringstr=request.getParameter("parm");页面中访问:Code highlighting produced by Actipro CodeHighlight 阅读全文
posted @ 2008-08-20 09:27 魔豆 阅读(2264) 评论(0) 推荐(1) 编辑
摘要: 方法一: 其实很简单,war包其实就是经过zip压缩的文件,用winrar压缩成zip格式,修改扩展名为war即可。 方法二: 使用MyEclipse,选择项目的根路径,右键Export->J2EE->WAR file(MyEclipse),下一步,选择war要保存的路径,确定即可。 阅读全文
posted @ 2008-08-19 15:48 魔豆 阅读(1431) 评论(0) 推荐(0) 编辑