本文转自TSS
http://www.theserverside.com/tt/articles/article.tss?l=SmartURLs
In this article, we jettison XML gluecode for "convention over configuration". Using the SmartURLs plugin for Struts 2, we can autowire Action classes to page templates with search-engine-optimized URIs.
This article covers: ...
取值要通过<s:property value="" />或在任意的<s:/>标签内使用%{};
当Action的valueStack中有该属性的值时,只需直接使用该属性的名字即可;
当Action的valueStack中没有该属性的值时,比如在session,application范围中的属性值时,需要加#或者#attr.;
例子:
假设某Action中有person成员变量,在application中存在company属性
那么我们可以通过以下方法取值:
<s:property value="person.name" />
<s:property value=" ...
使用JDK1.4运行Struts2.0
转自http://www.blogjava.net/puras/archive/2007/11/14/160590.html
刚刚把做完的项目从JDK5上移植到JDK1.4,事后整理一下,常常记记备忘录是个灰常好的习惯滴.呵.
Struts2.0默认的平台需求是:
Servlet API 2.4
JSP API 2.0
Java 5
但是因为一些原因,我们必须使用JDK1.4来编译,所以只能应用Struts提供的J4,来进行一下移植了,说实话,还是挺好的,只需要简单的操作,便可以把JDK更改为1. ...
JTA在处理分布式事务闻名已久,但是一直没有真正去玩过JTA,趁着这几天空闲,心血来潮想玩一把。经过一番周折,通过weblogic的JTA,并结合spring提供的简单配置,跑通了自己的第一个JTA事务。
记录一下,留个纪念,如果有朋友在实验中遇到同样的问题,也可以略加参考,希望对你有点帮助。
Step by Step
1. 安装Sqlserver 2000 + sp4
2. 在www.bea.com下载weblogic express 8.1。
3. 安装weblogic,并创建自己的domain实例,然后启动domain实例。
4. 浏览http://local ...
FAQs: JTA
Can I use a non-XA driver in distributed transactions?
Can I use more than one non-XA connection pool in distributed transactions?
How do XA and non-XA drivers differ in distributed transactions?
What XA drivers can I use in addition to the WebLogic jDriver for Oracle/ ...
I’ve recently switched from using JUnit 3.x to JUnit 4 for most new unit tests I write. One area that causes trouble is the use of JUnit 3.x based test base classes. Spring has a tree of helper classes based on junit.framework.TestCase that make writing tests that use an ApplicationContext, de ...
Introduction
Most enterprise applications rely on the database as the persistence mechanism. Integration tests for these applications require data in the database to run correctly. For integration tests to be repeatable, the tests should carry the test data they need with them and insert it before ...
转自:http://www.oreilly.com.cn/news/ant15toppractices.php?c=java
在Ant出现之前,构建和部署Java应用需要使用包括特定平台的脚本、Make文件、各种版本的IDE甚至手工操作的“大杂烩”。现在,几乎所有的开源Java项目都在使用Ant,大多数公司的内部项目也在使用Ant。Ant在这些项目中的广泛使用自然导致了读者对一整套Ant最佳实践的迫切需求。
本文总结了我喜爱的Ant技巧或最佳实践,多数是从我亲身经历的项目错误或我听说的其他人经历的 “恐怖”故事中得到灵感的。比如,有人告诉 ...
- 17:55
- 浏览 (186)
- 评论 (0)
- 分类: Project Build
Java提供了一套机制来动态执行方法和构造方法,以及数组操作等,这套机制就叫——反射。反射机制是如今很多流行框架的实现基础,其中包括Spring、Hibernate等。原理性的问题不是本文的重点,接下来让我们在实例中学习这套精彩的机制。
1. 得到某个对象的属性
<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br&g ...
- 09:25
- 浏览 (206)
- 评论 (0)
- 分类: Reflection







评论排行榜