Archive for the ‘javaee’ tag
JBoss Application Server 5.0.0 GA Released
Download it from here: http://www.jboss.org/jbossas/downloads/. If I remember correctly, the first beta was released more than two years back.
DI Example Using Spring
Based on a brief tutorial by a colleague of mine (Selvaraj S), I developed a small “Hello World” kind of example for Spring 2.5. The example is in Maven format, and can be downloaded from here.
JSR-286: Adding Header Elements
Some HTML elements like <link>, <script> may need to be placed in the HTML’s <head> section. For such needs, JSR-286 defines a standard way:
import javax.portlet.GenericPortlet;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.MimeResponse;
import org.w3c.dom.Element;
...
public class MyPortlet extends GenericPortlet {
@Override
protected void doHeaders(RenderRequest request, RenderResponse response){
Element e = response.createElement("link");
e.setAttribute("rel", "stylesheet");
e.setAttribute("type", "text/css");
e.setAttribute("href", "abc.css");
response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, e);
}
}
response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, ...) might be called for adding any number of headers.
We also have to add this in the portlet.xml (either in portlet scope or application scope):
<container-runtime-option> <name>javax.portlet.renderHeaders</name> <value>true</value> </container-runtime-option>
This is because javax.portlet.renderHeaders is set to false by default.