Wednesday, July 13, 2011

Debugging a web application Deployed on TomCat 7.0

We can debug our web application on Catalina.bat itself or Via Eclipse IDE.
I used TomCat 7.0 and Eclipse Ganymede for my Testing.
First I went to my TOMCAT_HOME/bin/catalina.bat
[TOMCAT_HOME=C:\Software\apache-tomcat-7.0.12\]
open catalina.bat with a notepad and Set two variables shown as follows,
set JPDA_ADDRESS=1044 (Testing port)
set JPDA_TRANSPORT=dt_socket

Then open the application via Eclipse IDE go to debug configuration and pass those argument on arguments.
JPDA_ADDRESS=1044 (Testing port).
JPDA_TRANSPORT=dt_socket.

Press Apply and Now Debugging :)

If there are different modules,Add thos e to the project. :)
This method can be used for JBOSS as well.
JBOSS is an Application server
ToMCAT is a web application server.

Sunday, March 6, 2011

Spring Framework...

Spring is a Java technology which is used to minimum decoupling objects.It will help you by Injecting beans externally,create objects.
Inside your dispatcher-Servlet.xml you can inject your bean.bean is known as a simple Java class.
ex:
this is injecting a object of AdminDaO.
For Spring framework developing we need to import special jar files externally.
commons-logging.jar -for logging Errors can be detected.logs file can be generated.
jstl.jar -java standard template library used for connect back end and front end.
junit-3.8.2.jar -used for testing purposes ,checks weather expected value and the given value is equals.
servlet-api.jar - used to manipulate request and response values manipulation.
spring.jar - this jar will supports their facilities to your code.
spring-jdbc.jar -supports to connect to database. basically configurations are their.
spring-webmvc.jar -supports to use MVC architecture of the framework.

MVC with Spring


Model -Hold the Business Logic of the programme.
View - Just JSP and HTML Pages.
Controller - controller calls the Model and view appropriately.

Tuesday, August 31, 2010

Enhanced JavaScript as JQuery

Jquery, next trend of the web developing, is used to add some fancy stuff to a web site. Using Jquery, programmers would do client side n server side stuff as well.Mainly focused on"The Write Less and Do more " , same thing can be done with java script, but while using jQuery number of lines is less.

Actually JQuery is a javascript header file:you can download it from here.
http://code.jquery.com/jquery-1.4.2.min.js

when you using it you need to import this script to the file all the time.
like this inside the header tags :

src="jquery-1.4.2.min.js"

Now you can write javascript functions using methods, functions declared inside that header.

The main advantage is Ajax Capabilities are there. The functions and methods therein allow programmers to load data from the server without a browser page refresh.Using Ajax API there.

Ex:

$(document).ready(function(){
$("button").click(function(){
$("#id_1").("background-color","yellow");
});
});

Above example shows you ,When you click on the button paragraph which are on id=id_1 area background colour will turned in to yellow.

Tuesday, August 24, 2010

joomla gives

As Joomla technology came to the web arena,Creating a web site site has become a easy thing.Customizing the components,We can create a basic website.

Step 1:Download joomla 1.5 zip file.
Step 2:Copy that file to server folder(create joomla folder)
do either one Xammp : paste it to c:\Xammp\htdocs\joomla folder
Wampe : paste it to c:\Wampe\WWW\joomla folder

Step 3:Run it -->http://localhost/joomla and install it.
Step 4:Do the essential configurations
Step 5:make sure and Do remember to remove the install folder from the joomla folder.

Now you are ready to create a website.

Tuesday, September 22, 2009

ICC Mini World Cup 2009 Begins....

Eight teams,fifteen matches,eighty eight players,Fifteen days and One Trophy.Eight teams have been here In South Africa to bring the Trophy their Home.But this time we can't predict that which team goes to win the ICC World CHAMPIONS TROPHY for 09/10.

Aussies comes out to the field as the dependable world Champions..They were the world champions in 2007.and Mini world cup champions in 2007 as well.





Hosts ,Home side being No 1 world cricket team in ICC ODI rankings. and they are hoping that "This time is their chance.Nobody can carry out the Trophy away ".





SriLanka India and Pakistan , Representatives of Asia Srilanka being a runners up of the ICC world cup 2007.India come up with a strong batting line up. and Pakistan being a strong and capable of changing the match.



Kiwi es here in SA after a long tour in SriLanka and made it fine.
Here is the top 6 teams in ICC world ranking .







Including West indies and England . There responsibility to show colours to spectators. In Natwest series they got a unhappy experience with Australia.




West Indies won't play their full team.

Monday, September 21, 2009

Casting Objects

One Object reference can be type cast in to another object reference.That class can be to its own class type or to one of its super class or sub class typees or interface.


In Java we can do Object casting in two types.

# Up Casting
# Down Casting

Let's say we cast a reference along the class hierarchy in a direction from the root class towards the sub class.So this is kown as the Down Casting.

When we cast it towards the sub class to super class , It's known as Up Casting.
In this case we do not need to use class operater.

We will take a look at a Simple Example..

Ex A.
UpCasting

Class Animal{
}
Class Dog extends Animal{
}
Class DogTest{
public static void main(String[]args){

Dog dog=new Dog();
Animal animal=dog; //Up Casting.This is ok with no explicit cast.
Animal animal=(Animal) dog; //Up cast ok with explicit cast.

Ex : B

Down Casting

Class Animal{
}
Class Dog extends Animal{
}
Class DogTest{
public static void main(String[]args){

Animal animal =new Animal();
//Dog d=animal; //we cant write it like this .
Dog d=(Dog)animal;//now this is ok .But compiles it .but gives a run time error.
}

imp:- When we doing Down casting we can compile it. but when we run it it gives an error like this.

java.lang.ClassCastException.

Wednesday, September 16, 2009

Python : -" Hello World "

Befor you start learning PYTHON you will have to have python software. This software can be downloaded from follwing link:

http://wiki.python.org/moin/BeginnersGuide/Download.

you should download the relevent packege according to your operating system.

Install it .


now Let's how can we write out first programme.

1.
we can do it with using Phython shell.

click on START button then ALL PROGRAMS then PYTHON2.6 then select IDLE(python GUI).

white screen consol will be appeared .

type on there as follows;

When you type like that Hello World will be printed there ,itself.



print " Hello World"


Hello World


2.
we can do it using python command line.

click on START button then ALL PROGRAMS then PYTHON2.6 then select PYTHON(Command Line).

Then black colour consol will be appeared ;

you can type it as above example and or as follows.

print "Hello World " * 3


Hello World Hello World Hello World


rem : when you are multipling by 3 . there should be a gap either side of "*";

3.

you can try this out with the operating systems's consol application.
if it is Windows -MS Dos.
Ubuntu -Ubuntu Konsole.
Kubuntu -Kubuntu Konsole.

Befor you use that you need to configure the path .

path is like a specfic preticular place where python's file saved.you can make it as like Java path.

Then go to cmd prompt. And change to your "python 26" dirctory .

And Then type on the consol like python.look follows.

fisr appear as :-

c:\Python26>

then type "python"

c:\Python26> python

After that you can print what ever thing you want . same as we did in the above examples.

print"I am a technology Geek"


I am a technology Geek



4.We can do codings stuff using a text editor.
type on your editor as

print "Lahiru" * 3

then save it as .py extension..

like this lahiru.py

make a folder inside python26 folder and save it inside that.

let's say your folder name is PythonProjects.

Then go to the consol application and go your project sved place.
like this

c:\Python26\PythonProjects>_

go to above place and type the python an filename with the extension.as follows.

c:\Python26\PythonProjects>python lahiru.py

Then out put will be :


Lahiru Lahiru Lahiru



Imp:-

If you want to go out from the pythons Server to your friendly Editor use Ctrl+Z