Archiv für die Kategorie ‘Tomcat’

Coding by Convention with Grails

November 13, 2006

Not so long ago the 0.3-Version of grails was released. A good reason for me to check what this coding-by-convention is all about.

An it seem to be all great! The opposite is the application i am working with. And with our app all came up with good intentions for the following reasons:

  • being flexible: The cutomers/users dont have to decide what they want or what they need, we can configure this later…
  • being different: the different companies dont want to adjust their internal workflows and they dont have to. we can configure all the differences

This is becoming more and more configuration with every new implemented feature. In the end your are not a developer any more, your are a configurer. –> Configuration Hell!

Coding-by-convention must be precise. You must exactly know whats best, what you need or how to name something. No more maybies.

Ressources for grails:

Misc Java Notes

Juli 26, 2006
  • Intelligent WEB-GUI-Components (kind of Ajax):
  • New eclipse version: What’s new in Eclipse 3.2?
  • Java-classpath-configuring in Windows: with the following two Batch-Files it is possible to add all the files of a directory to the classpath. (Copied from here)
    build.bat
    ---------
    set CP=
    
    for %%i in (lib*.jar) do call cp.bat %%i
    cp.bat
    ------
    set CP=%CP%;%1
  • how to let tomcat destroy a session. Two options: in the web.xml-configuration or in ur application.

dollar signs ($) in tomcat’s server.xml configuration file

Mai 25, 2006

tomcat.jpg The problem has begun with a new security policy in the company. Beside other conditions how a password must look like (length, numeric-alphanumeric, upper-lower-case) it was said that it is necessary to include a special character in each of the passwords. My favorite one was the dollar sign ($)…

For accesing a databases with tomcat (i used version 5.0.28) I need to configure a jndi data source via jdbc as it is described here. I typed my password like (this is not the real one) with the $-sign:

iGet$4work

Result: The jdbc-driver said that the password was wrong.

After different tries of rechecking and checking some encoding stuff I used ethereal to see what my tomcat was actually sending:

iGet4work

What do I get 4 work? No dollars – Nothing – Huh – maybe next time I stay at home. Not the right solution.

How it worked?

You need even more dollars, just use

iGet$$4work

and the right password is send over the network. Tomcat got the DB-Connect and I was happy.

What I have learned?

  • Internally in most tomcat confguration files the dollar sign is used for variables
  • sometimes it is better to double the dollars

Next time: Maybe I cover the topic how to specify a password with #-signs in unix-scripts or java.propertie-files;-)