Programming
13 May 2012 12 Comments

Hello World with JSF 2.0, Glassfish 3, Maven, SVN and Eclipse

Introduction

Serious Java Web application development requires a lot of different applications. In addition to a JDK, an IDE and an application server you may need a Web application framework, a build system and some form of version control. Unsurprisingly, getting set up for development can be quite the task.

In this post we’ll take a look at setting up a Web application project from start to finish. The software we will use is:

What Are We Building?

Different applications come in different forms.

  • A Windows application written in C++ may be compiled to a .exe file.
  • Runnable Java GUI applications often come in a JAR (Java ARchive).
  • Java Web applications are packaged in WAR and EAR files.

We are building a Web application, so the product of building our project will be a WAR file. The Glassfish application server extracts a WAR file and runs the application inside it. The WAR file also contains a deployment descriptor, web.xml that describes how the application server should run the WAR.

The structure of a WAR file looks like this (source):

Project Setup with Maven Archetypes

Now that we know what we are building, it is time to start setting up the project. The directory/file structure…

Reversing
26 February 2011 6 Comments

Assembler Tutorial: Hello World with NASM and CL.EXE or LINK.EXE

Introduction

If learning assembler with the NASM.exe assembler peaks your interest, you might be interested in this extensive tutorial by Paul Carter. Annoyingly, finding a linker on Windows that plays nice with NASM took me a while. The tutorial by P. Carter is not very clear on this matter. I wanted to use the linker link.exe that comes with Visual Studio 2010, because the free DJGPP linker that is mentioned by Mr Carter generates badly formatted .exe files. In this post I will show how to compile and link a Hello World assembler program with nasm.exe and link.exe.

Compiling Assembly Code

Let’s compile and link this Hello World program (courtesy of Ray Toal) in a file named helloworld.asm.

; This is a Win32 console program that writes "Hello, World" on one line and
; then exits.  It needs to be linked with a C library.
 
global  _main
extern  _printf
 
section .text
_main:
push    message
call    _printf
add     esp, 4
ret
message:
db      'Hello, World', 10, 0

As you can see we use the printf() function to print the text “Hello, World”. This function is marked as extern, because it is an imported function (it resides in the C Runtime Library).

The tutorial …