Thursday, January 6, 2011

Installing and configuring apache tomcat 7.0.5 for JSP

For all those who is trying to code JSP, they need JSP server. Up-to now Apache tomcat is the most stable and good server for JSP programs.
Software Needed
=>JDK (click here to download)
=>Apache Tomcat (Click here to download)

Installation
=>install JDK in your local drive(its default path is c:/programe files, you can change its location but it is recommended to use the default settings.)
=>Tomcat will be in .rar format. Extract the file in the suitable location(Make sure once you configure tomcat, you tomcat folder will be worked as primary location. so keep the files in the location where u can easily access and save your files. i am assuming that u have extracted you tomcat file on desktop)

Configuring Tomcat
I am using Windows 7, so the screen shoots and instruction will be based on Windows 7. however, other MS OS almost have the same mechanism.
=>Right Click on "My Computer"->Properties->Advanced setting->Environment variable.
=>Under user variables for username, click new.
=>A small window will open with title "New User Variable".
=>In "Variable name" type "JAVA_HOME"(make sure it is in capital) and in "Variable value" give the location of jdk folder.in my case Jdk folder is installed in default location (IE C:\Program Files\Java\jdk1.6.0_21). Best practice is to copy this location and paste it in the Variable value. And press OK.

=>Again click on New from User variable and in variable name type in "Path"(make sure P is capital only) and in variable value type in "%JAVA_HOME%\bin" and hit OK.
=>Hit Ok to exit from the environment variable window.
=>now start command prompt.(You can do it by typing cmd in run and shortcut key for eun in window + r).
=>Now enter in ur extracted apache tomcat folder from cmd.(as i extracted it on desktop, so i am showing you for desktop). it can be done by typing "cd Desktop/apache-tomcat-7.0.5"(your version may change).
=>Go in bin folder by typing "cd bin" in command prompt.
=> Now type startup.bat and press enter. Another window will open showing that the server has been started successfully.



=>Minimize the Command Prompt.(Do not close the command prompt or else the server will be stopped.)
=>Open Browser and type in "http://localhost:8080"(Theri is a colon between local host and 8080). if everthing works fine you will see the apache tomcat default screen.
=>And now you JSP code is ready to use. :)

Running JSP Code
Inorder to run JSP code i am showing you a simple programe to show you where to save how to save and how to run the jsp code.
=> Open Your Favorite editor.(i use Notepad ++) write a jsp code.

=>save file as <name>.jsp (.jsp is an extension for jsp programes), i named it sample.jsp. And save it in apache-tomcat/webapps/ROOT. (apache-tomcat is the same folder which we extracted at the very beginning).
=>After that go to browser and type "http://localhost:8080/sample.jsp"(Your file name could be different, no worries all u have to do is replace the sample with you file name.)
=> Yes you have succesfully isntalled and configured you apache tomcat server.
=> For any quries comment on this post.

Note: every time, to start the server you have to follow the command prompt procedure again. the rest is fine.

Have a nice day :)

Tuesday, September 21, 2010

logical VS legal

Hey readers, this time i decided to post something more interesting rather then a typical computer based post. So this time, i have decided to put a kind of a joke. Well this joke is in a form of  story. but before telling u the actual story, guess this:
what is legal but not logical, logical but not legal and neither legal nor logical.
 Think on this then i will give you the answers ;)






ohk now i am disclosing it.....
A young law student, having failed is Law exam, goes up to his old professor, who is renowned for his razor-sharp mind.
Student:"Sir, do you really understand  everything about this subject?"
Professor:"Actually, i probably do. otherwise i wouldn't be a professor, would i?"
Student:"OK. so i'd like to ask you a question. If you can give me the correct answer, i will accept my marks as it is. if you can't you"ll have to give me an "A".
Professor:"Hmmmmm.. alright, So what's the question?"
Student:"what is legal but not logical, logical but not legal and neither legal nor logical. "

The professor racks his famouse brain, but just couldn't crack the answer.

Finally he gives up and changes the student's failing mark into an "A" as agreed, and the student goes away, very pleased.

The professor pondered over the question all afternoon, but still couldn't get the answer.

So final;ly he calls a group of his brightest students and tells them he has a really, really tough question to answer and he put forward the question.
To the proffessor's surprise(and embarrassment), all the students immediately raise their hands.

"All right!" says the professor and asks his favourite student to asnwer?

"It's quite easy, Sir" says the student"You see, you are 75 years old and married to a 30 year old woman, which is legal but not logical. Your wife has a 22 years old lover, which is logical, but not legal. And your wife's lover failed his exam but you've just given him an "A", whcih is neither legal, not logical"

I found it very interesting and decided to share with you guys, hopefully you enjoyed it,.

Monday, September 13, 2010

Making your USB drive bootable for windows 7

i saw couple of post regarding this topic but believe me guys those all tutorials are very hard to follow. i wounder when there is an easy way to do the job then y to go for more harder one... i assume you are a windows XP user and you want to install windows 7, so here is how you do that...


Requirements:
USB Pen Drive (Min 4 GB)
Windows 7.iso

Software needed
MBRwiz Click here to download and Extract it on your hard drive (Diskpart utility for Windows XP doesn’t detect USB drive as Disk hence we need to use this free utility to make bootable USB drive).
Virtual drive (i prefer virtual clone Click here to download its free and easy to use. )

You have these things and you are good to go.

  1. connect your USB in your computer. Navigate USB from My computer. right click on USB drive Icon and click format. (if you have any important data in USB, save it first).
  2. Mount your windows 7.iso in virtual drive.
  3. Goto command prompt(start -->rum <type "cmd"> and press OK ).
  4. Now dir to directory where you have extracted MBRWiz and run following commands.
mbrwiz /list (note down disk number of your USB Pen drive)
mbrwiz /disk=X /active=X (X is Disk Number of your USB Drive)
exit
    5. now type these commands
J: (Drive letter of Windows 7 iso mounted with demon tool)
CD boot
bootsect /nt60 Y: (Y is drive latter of your USB drive )

    6. Now copy all files from drive where you have mount Windows 7 iso.
    7.Now reboot your computer and press F9 to get your BIOS screen and select USB drive as your boot   drive.
    8. If every thing goes fine, Your Windows 7 Installation should start from your USB drive.