Java Reference
In-Depth Information
ParserContext pc = new ParserContext() {
public String getExpressionPrefix() {
return "${";
}
public String getExpressionSuffix() {
return "}";
}
public boolean isTemplate() {
return true;
}
};
String templatedExample = parser.parseExpression(
"The millisecond is ${ T(System).currentTimeMillis() }.", pc).getValue(String.class);
2-5. My Code Doesn't Compile!
Problem
Perhaps you've happily updated to the latest and greatest Spring and waited for your workspace to
refresh when—egad!—you encounter compilation errors!
Solution
There is none, as such. Some things are deprecated and have been removed. In the interim, your best bet
is to upgrade or use alternatives to prepare for Spring 3.0.
How It Works
Besides the obvious elevation of the require baseline Java environment, most of the changes are
backward compatible. Indeed, if anything, there's more added, and the coding conventions are the
same. The new version is 95 percent backward compatible with regard to APIs and 99 percent backward
compatible in the programming model. However, in order to embrace natural evolution, some APIs are
being deprecated or removed in this release:
Traditional Spring MVC controllers built on the older Spring MVC controller
hierarchy. If you've been using the annotation-friendly version of Spring MVC
introduced in Spring 2.5, you don't need to worry about it.
Spring now officially supports Java 5, and with it Java 5 annotations. The support
for the common attributes metadata (to enable solutions on Java 1.4) is no longer
necessary.
Traditional support for the object/relational mapping (ORM) layer TopLink is no
longer available. This doesn't apply to the JPA provider support, of course, just to
the original proprietary technology, including the TopLinkTemplate and the like.
The testing support that debuted in the Spring 1.x series supporting JUnit 3.8 is
no longer available, although there is a fantastic alternative in Spring's updated
testing support based on JUnit 4 and TestNG as well as Spring's own testing
framework.
 
Search WWH ::




Custom Search