Showing posts from October, 2011

Apache Tapestry PageActivationContext tutorial

The idea behind this annotation is nice and very simple. It's all about telling tapestry how to hypothetically convert a string to an object of your choice. This string is actually a key used to look up a desired object.

Now to do that you need to provide tapestry with your value encoder implementation then go ahead and use the @PageActivationContext annotation.

First create a value encoder service :

import org.apache.tapestry5.ValueEncoder;
import com.jarmy.beans.UserInfo;
public class UserInfoEncoder implements ValueEncoder, ValueEncoderFactory {
    private final UserDAO userDao;
    public UserInfoEncoder(UserDAO userDao) {
        this.userDao = userDao;
    public ValueEncoder create(Class paramClass) {
        return this;
    public String toClient(UserInfo paramV) {
        return paramV.getId();

Apache Tomcat 7 JAVA options

I needed to increase tomcat 7's heap size and provide an environment variable at the command line and here is how I did it:

In Tomcat's bin folder, open catalina.bat file in a text editor.Replace the following statement:set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%
By this one:
set JAVA_OPTS=-DIPK_CFG=C:/Skycomm-CTH/ -Xms64m -Xmx1024m %JAVA_OPTS% %LOGGING_CONFIG% If you have a better suggestion, please add it as a comment.