Categories
Java Tomcat

Undocumented Java WebStart Features

Many of you might use Oracle’s JNLP Download Servlet, delivered with JDK in jnlp-servlet.jar. One of the nice features of this servlet is the automatic replacement of variables at runtime, e.g. codebase and context. However, the existing documentation does not reveal all of these replacements. While searching for a solution where I need to put the server name into the JNLP file, I also examined the source code of JnlpDownloadServlet. And voilá: the feature is already there but not documented.

Here is the complete list of replacements that the servlet does for you while delivering a JNLP:

  • $$name: will be replaced by the name of the URL file requested (without path, e.g. myfile.jnlp)
  • $$hostname: will be replaced by the servername as given in the HTTP(S) request
  • $$codebase: will be replaced by the codebase (request without URL file: http://my.server/appname/somedir/)
  • $$site: will be replaced by the protocol, server and port, e.g. http://my.server:8080

I hope you’ll find that useful next time you look for a solution to deliver WAR files to individual servers with the specific servername in its JNLP file.

Categories
Linux

Convinient GRUB multi-boot configuration

These two lines in /etc/default/grub let grub2 remember what system you booted last time and will automatically start this system when rebooting:

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true

You need to update grub2 afterwards to have the new configuration activated:

update-grub
Categories
Bugzilla for Java CSV Projects Templating

Nightly Builds

To all of you who don’t want to wait for the next releases of any of my projects there are good news. I introduced Nightly Builds now which are linked on individual project’s pages. In case you detect any missing build, just send me a message via the contact page.

Categories
Miscellaneous

Calendars 2011

I know, 2011 has already started a few weeks ago. However, I still owe you the DIY Planner calendar. Of course, the calendar differs from Ygor’s template in having week numbers on all templates. This year, I translated it to German as well, so you can have the German or the English version for download.

Unfortunately, I haven’t been able yet to create a Windows executable that runs without any additional library. So you have to build the version from your own scratch. The source code is available at my Subversion repository.

Categories
CSV

CSV/Excel Utility Package V2.1 released

I finished this release some months ago but didn’t find time yet to finally release it. Version 2.1 introduces some new features and classes that ease handling of table-like data from different sources:

  • New TableReader implementations for JDBC, XML, JTable
  • New TableWriter implementations for HTML and XML
  • Introduction of type conversion to allow object-string conversion and vice versa while reading and writing tables
  • New Reader and Writer wrappers that read and write JavaBeans.
  • New Filter implementations for TableReader that remove rows and columns.
  • Some abstract classes were separated into general base classes and stream-handling classes. This allows easier development of non-stream based implementations.

You can download the new version here or visit the Homepage of the utility where you will find some examples on how to use it.

Categories
Typo3

Typo3 and RealURL

I use various sites with Typo3 and RealURL extension. Mysteriously, it sometimes happens that links at the frontend do not work after updating Typo3 itself or any extension. Problem detection is very complicated because RealURL has a very hidden and strange behaviour. Even worse: it seems that there is no rule on what links can be decoded and what not.

Main things you have to do if you get “segment X ist not a postVarSet variable” error:

  1. Make sure you are logged off from the backend
  2. Make sure you give RealURL a chance to fill the path cache by clicking in your frontend from top to bottom!

What internally happens is as follows: Once the path cache is emptied, it will be filled again only when you are logged off from backend. I have no idea why RealURL implemented this feature but it has a special condition check before updating the cache that makes sure the user is not logged into the backend.

Furthermore, cache update happens only when “Encoding” takes place (ID to path translation). That means that you will get the postVarSet error when you try to get a page from your frontend before RealURL did encode it. That’s why you have to click “down” your website from top to bottom, so all links are created before they are ever requested by your browser.

So next time just follow this two simple rules and your RealURL extension will behave as expected.

Categories
Miscellaneous

Subversion Web Browsing

The default solution to subversion browsing is WebDAV within Apache. However, it has some drawbacks. You cannot browse history, see comment histories or even check filestamps.

WebSVN provides all these features and comes along with a very modern style. The best of all: You don’t need to install any additional modules. All that WebSVN requires is a current PHP version.

I just switched from the WebDAV solution here on my server to WebSVN. So, check it out…

Categories
CSV Java

CSV/Excel Utility Package V2.0.2 released

The package has undergone some minor bugfixing andJUnit Test was introduced for CSV files. Thanks to eldn for his help making this release.

You can download it here or visit the Homepage of the utility where you will find some examples on how to use it.

Categories
CSV

CSV/Excel Utility Package V2.0.1 released

It took me quite some time to upgrade this package to the next level and support Excel. It propably still has some flaws. However, I use it now for some months in production and fixed the most critical bugs. In fact, it seems to run quite stable now.

Please note that upgrading from previous version will require you to update your package imports.

You can download it here or visit the Homepage of the utility where you will find some examples on how to use it.

Categories
Java

Log4j Configuration Problem

It seems that some documentation that is hanging around the net contains incorrect information about correct configuration of the log4j system.

Take care that you specify the properties filename as an URL rather than simple plain path location, e.g

java -Dlog4j.configuration=file:///my/path/to/log4j.properties ...

Log4j should find your configuration then. So make sure you include file:// there… 😉