In a certain stage of webapp-development, there is the requirement to deploy your application to a “real” webserver. If you are using Maven for your build-management you probably use the provided jetty plugin. This plugin allows you to start your application without downloading and configuring a webserver on your own.

The difference between a webserver on the internet and a local machine is the accessibility and the need, to encrypt your sessions. This is normally done by providing a HTTPS-protocol access to your web-application.

Hubert Klein Ikkink has written a nice blog-post how this can be achieve with the jetty-maven plugin.

Click here for the blog-post

The usage of a Logging-Service in Tapestry is quite easy. You just have to use the @Inject Annotation in your classes.

import org.slf4j.Logger;
@Inject
private Logger logger;

A little bit more complicated is the usage in a Tapestry-Service. Here an @Inject Annotation will fail, so you would have to get an instance for your logger from another source. One possibility would be to use a build-method in your Module class. But then, you would have to distribute such method for each service which should use a logger.

Tapestry helps you here and can contribute the needed Logger instance if you insert a constructor method to your service:

import org.slf4j.Logger;

private final Logger logger;

public MyServiceImpl(final Logger _logger){
     this.logger = _logger;
     this.logger.debug("Successfully initialized MyServiceImpl);
}

Your Service will now be initialized with a working instance of the Logger-class.