6/09

6/09

6/09

6/09

6/09

6/09

Get rid of GET forms

I always try to stay away from GET urls, because they allow users to pass any data to your application via the URL, and that can be a very bad thing. Here's how I get rid of them:

C Scales and Patterns

Here are a few C-Major scales and melodic patterns for the 5 string banjo. Here is the midi

C Major Scale
     E  E  E  E  E  E  E  E     E  E  E  E  E  E  E  E   
D||-----0-----3-----3-----0--|--------------------------|
B||--------5-----------5-----|--------------------------|
G||--5-----------------------|--5-----5-----------------|
D||--------------------------|--------------------------|
G||--------------0-----------|--------------------------|

Melodic Red Haired Boy / Little Beggarman in G and C

The fiddle player I play with plays this in D and A, so I worked it out for a G and a C position, so I can capo at the second fret and play in both keys.

Here is the G part:

Tomcat 5.5, Struts 2, Spring, and SpringSecurity with Tomcat's security manager on

I have a Tomcat 5.5 server, running an app using:

Struts 2
Spring
Spring Security

I highly recommend Spring Security. Now, I need to have a couple of files that are accessed that are outside of the webapp/myapp directory. The way to do this is with the Tomcat security policy file. According to the documentation, you enable it with:

$TOMCAT_HOME/bin/startup.sh -security

This should read the $TOMCAT_HOME/conf/catalina.policy file to allow such access. Now, the default policy does not allow Struts 2 and Spring to work, so it needs some tweaking just to allow the application to start. Read on for my struggles with this.

Extending Struts 2 Tags Example, Making the checkboxlist tag multi-line

In using/learning Struts2, I ran into a situation where I needed a lot of checkboxes in a form. The checkboxes from the xhtml theme do not have a break after them.

I was using Spring Security, and needed a form with checkboxes for the roles. Looking at the xhtml form tags, most of them generate table rows for the form fields.

The solution I came up with was to extend the checkbox tag to use table elements for each checkbox in the list, rather than one for the whole lot of them. This puts them each on their own row in the table, and is much more readable. This is particularly the case if you have more than a one-word description beside the checkbox.

To see how to do this, read on...

Syndicate content