You’ll often want to configure parameters in a properties file and read this into a class.
config.properties:
value.a=orange
value.b=apple
If you’re simply loading a file in a java program you can use:
Properties props = new Properties();
props.load(new FileInputStream(“config.properties”));
String value = props.getProperty(“value.a”);
But when loading a property file in a web application you should package the file in your deployed archive and [...]
Entries from March 31st, 2009
Loading a properties file in a java web app
March 31st, 2009 No Comments
Tags: java · properties
Automated Build – Mysql database scripts
March 30th, 2009 No Comments
Having set up the basic folder structure in Automated Build Databse scripts you now need to add the mysql scripts.
You create them in PROJECT_HOME/db/mysql/testdb
db/mysql/testdb/build-mysql-testdb.xml
db/mysql/testdb/createTables.sql
db/mysql/testdb/dropTables.sql
db/mysql/testdb/populateTables.sql
db/mysql/testdb/testData.sql
The build script itself is fairly self-explanatory. It replicates the targets from the master build script. It reads the mysql.properties and schema.properties files and adds the correct jar file to the classpath.
For [...]
Tags: automated build · mysql
Automated Build – OracleXe database scripts
March 27th, 2009 No Comments
Having set up the database folder structure in Automated Build Database scripts you now need to add the oracle xe scripts.
You create them in PROJECT_HOME/db/oraclexe/testdb
db/oraclexe/testdb/build-oraclexe-testdb.xml
db/oraclexe/testdb/createTables.sql
db/oraclexe/testdb/dropTables.sql
db/oraclexe/testdb/populateTables.sql
db/oraclexe/testdb/testData.sql
The build script itself is fairly self-explanatory. It replicates the targets from the master build script. It reads the xe.properties and schema.properties files and adds the correct jar file to the [...]
Tags: automated build · oraclexe
Automated Build – Database scripts
March 25th, 2009 No Comments
When you’re developing a project, you put all your java code into source control. You should also include database scripts in source control. These scripts can be used by developers to keep their local copies of the database up to date in the same way as they get the latest code from source control.
As part [...]
Tags: automated build · database scripts
Automating your Build – The Very Basics for a Beginner
March 24th, 2009 No Comments
This post covers the absolute basics for a beginner of setting up a minimal build script for building and deploying code as a jar/war/ear file.
Alfresco Part Four – Accessing Alfresco webclient from a url
March 20th, 2009 4 Comments
Having created a space in Part Three, we now want to access it from our web application. The Alfresco web-client provides some servlets to allow URL-based access to pages within the client. To use these servlets without having to log in you have to request an authentication ticket via a web services call [...]
Tags: alfresco
Alfresco Part Three – Create a new workspace using a web service call
March 19th, 2009 1 Comment
How to access create a new workspace in Alfresco using a web service API.
Tags: alfresco · web service
Rebounding
March 19th, 2009 No Comments
I’ve been trying out different forms of exercise each year to see which ones I like best, and also just to vary the workouts I do so that they’re more effective. For about 4 months now I’ve been taking rebounding classes at least once a week. Luckily for me, they’re one of the free classes [...]
Tags: rebounding health
Alfresco Part Two – Deploying Alfresco on JBoss
March 18th, 2009 6 Comments
Steps for deploying Alfresco on a JBoss server.
Alfresco Part One – Using Alfresco for document management
March 16th, 2009 No Comments
We’d like to use an open source document management tool in conjunction with our web application. I looked at configuring Alfresco for the task, how to integrate it with the external data and reuse as much as possible of the document management features available in Alfresco.
The first steps were to download, install, configure and explore the Alfresco application…
Tags: alfresco · document management