Simple Servlet example without eclipse

Simple servlet example – how to create servlet without eclipse

These days we are all surrounded by heavy frameworks that make life easier for us. Like maven, spring and hibernate and more. But how can we create a simple servlet website without the need of all those.

The main idea of servlet lies around very simple and intuitive files and structures. Knowing those only is good enough to built a good web app and that is what I will be showing here.

The main parts of the java web app are the following.

1. The Servlet – the java class that is handling the POST and GET http verbs
2. the deployment descriptor – web.xml. File telling how the webapp should be interacted like the url pattern
3. Servlet jar file – This is the jar handling the magic of interaction with the web for the servlet.

Structure of the webapp

J2EE Maven Eclipse Hello World Tutorial Part Two

Hello World Beginner Tutorial using J2EE and Maven

This is part two of J2EE application with maven continued from Part One.

If you haven’t accomplished J2EE with Maven tutorial, please first complete it by going here

Maven relies highly on the pom.xml file that we would put on the project root folder. Lets do that.

In this part of J2EE tutorial and Maven tutorial, we will proceed from creating a pom.xml file which is the heart of maven.

3 Create the pom and compile the project using maven.

3.a put the following pom file in the MavenEclipseJ2EE directory.
Continue reading J2EE Maven Eclipse Hello World Tutorial Part Two

asadmin-command-unknown-in-glassfish-ee-application

am a great user of tomcat when it comes to Java web application. I had fun with it. Being fast and allowing a bunch of things to be done by myself.. that being said, I am a regular user of glassfish as well. Specially the later version 3 looks awesome in a lot of ways..

I will try to use this blog to amend any hiccups whenever they appear and a bit of more tutorials as well.

The first one is the command line friend asadmin.

On the new version it will be found on

/glassfish-main-directory/glassfish3/glassfish/bin

Being on this directory if you issie

./asadmin

You will get the command line for it.
To add it to your path so that you can use it from any where in your terminal, just add it to your path

open your ~/.bash_profile or .bash_rc [create it if it doesnt exist and add the above directory at the end of it separated by appropriate directory separator.

That is it..