How to programmatically resolve property placeholder in Spring

Since Spring 3.0.3 there is EmbeddedValueResolverAware which will work same way as mentioned by another post which uses appContext.getBeanFactory().resolveEmbeddedValue(“${prop}”) call. To solve the problem: Make your class to implement EmbeddedValueResolverAware interface and you will get resolver injected for you Then where you will be able to retrieve properties as demonstrated in a code snippet: String … Read more

Default value on JSP custom-tag attribute

There is a better way: <c:set var=”title” value=”${(empty title) ? ‘Default title’ : title}” /> No need for custom tag in Java nor tld. Just plain JSP EL and conditional operator. In my opinion it is shorter and cleaner than old: <c:if test=”${empty title}” > <c:set var=”title” value=”Default title” /> </c:if>

What’s the difference between including files with JSP include directive, JSP include action and using JSP Tag Files?

Overview of JSP Syntax Elements First, to make things more clear, here is a short overview of JSP syntax elements: Directives: These convey information regarding the JSP page as a whole. Scripting elements: These are Java coding elements such as declarations, expressions, scriptlets, and comments. Objects and scopes: JSP objects can be created either explicitly … Read more