![]() |
![]() |
|||||
Hello, World! Web AppTen Quick Steps for Deploying a Super Simple JSP Web App (WAR) on JBoss AppServerTutorialFollow these steps to install JBoss and then create and test a simple web application (WAR). The steps are designed for Windows XP, but you should be able to modify them for other OSes without too much effort.1) Install JavaObtain Java by clicking the ">> Download" button for JDK 6 Update 6 at:http://java.sun.com/javase/downloads/ Run the installer with the default options, which will install Java into "C:\Program Files\Java\jdk1.6.0_06\". Note: Application servers, like JBoss, require the full JDK (Java Development Kit), which contains the JRE (Java Run-Time Engine) plus a bunch of stuff for developers, such as the "javac" compiler. 2) Install JBoss Application ServerGo to the JBoss download page at:http://labs.jboss.org/jbossas/downloads Locate version 4.2.2.GA, and follow the "Download" link to get the "jboss-4.2.2.GA.zip" file. Unzip the file into "C:\Apps\JBoss\". 3) Create Work FolderCreate a folder called "HelloWorld" separate from your JBoss installation. For example, the full path of your work folder could be "C:\Projects\HelloWorld".4) Create Startup ScriptIn the "HelloWorld" folder create a file named "JBoss.bat" with the following content:JBoss.bat
@echo off
set JAVA_HOME=\Program Files\Java\jdk1.6.0_06 set JBossHome=\Apps\JBoss\jboss-4.2.2.GA set Path=%JAVA_HOME%\bin;%Path% cd "%JBossHome%\bin" run.bat This script will launch JBoss. 5) Launch JBossRun the "JBoss.bat" file you just created.6) Write JSP FileAlso in the "HelloWorld" folder, create a file named "hi.jsp" as:hi.jsp
<html><head><title>JSP Test</title>
<%! String msg = "Hello, World."; %> </head> <body> <h2><%= msg %></h2> <%= new java.util.Date() %> </body></html> This JSP simply displays a greeting along with the current date and time. 7) Create Deployment DescriptorIn the "HelloWorld" folder, create a sub folder called "WEB-INF", and in that folder create a file named "web.xml" as:web.xml
<web-app>
<display-name>Hello World</display-name> </web-app> The deployment descriptor provides information to JBoss about your web application. 8) Create WAR Builder & DeployerIn the "HelloWorld" folder, create a file called "Deploy.bat" as:Deploy.bat
@echo off
set JAVA_HOME=\Program Files\Java\jdk1.6.0_06 set JBossHome=\Apps\JBoss\jboss-4.2.2.GA "%JAVA_HOME%\bin\jar.exe" -cvf helloworld.war *.jsp WEB-INF copy helloworld.war "%JBossHome%\server\default\deploy" pause This script uses Java's JAR utility to zip up the appropriate contents into a WAR file. 9) Do ItRun the "Deploy.bat" file.10) Test Your Web PageIn a browser, open "http://localhost:8080/helloworld/hi.jsp" to see your web application run.Now explore the JBoss console at "http://localhost:8080". Click on "JBoss Web Console" and expand "J2EE Domains", "jboss.management.local", and "JBoss". Select "helloworld.war" to see information about your web application. That's ItFor your convenience, here's the completed Hello World! Web Application:HelloWorldWebApp.zip (screen shot) If you're ready to take the next step to servlets and EJBs, try these tutorials: Laliluna EJB Tutorial Eclipse EJB Application JBoss EJB Tutorial If you know of any better EJB tutorials, please send in your suggestions. Questions or Comments:All the fields are optional. However, if you want a response, make sure to provide your e-mail address.Random
"very nice. within 2 min i run my first hello world."
December 19, 2007 "Great little example to get you started, thanks!" P., November 13, 2007 "Congratulations, your tutorial is very good and simple !!" F., October 25, 2007 "It's really helpful... The easier way u have explained all the steps is really useful." R., October 15, 2007 "Very Effective Crisp Steps. Thanks!" V.B.S., October 8, 2007 "thanks a lot....this is simple and easy....this helped me a lot!!!!!!!!! i got exactly what i had been searching for!!!!!!!!" V.A., October 7, 2007 "The tutorial writer has served a a great cause in favour of developer community by writing this masterpiece tutorial. Hats off to you boss!" M.T., September 5, 2007 "OMW......THIS IS REALLY EASY.....THANKS SO MUCH......this help me a lot!!!" J., August 31, 2007 "Wow, really that simple! thanks a lot" P.S., July 18, 2007 "A powerful crash-course for deploying web application to jboss for biginners. A bottle of water for a thirsty." N.S., July 17, 2007 "At last!! A simple, yet superb, JBoss tutorial! Thanks a lot" J.M.F., July 11, 2007 "This is the best page I have ever read!" D., June 15, 2007 "very good tutorial for starter, helped me... Thanks a lot" Z.C., June 7, 2007 "thank u very much for this simple and very helpfull one for which i looked for and the right one at right time.." M.U.R., May 30, 2007 "Thanks a lot...it was a great help...a stepping stone towards JBoss" H.H.D., May 23, 2007 "Thank you for posting a TRUE Helloworld WAR Example using JBoss. Just the facts was all I needed, Great Job" B.E., May 14, 2007 "This tutorial is realyy excellent" A.S., December 27, 2006 "This tutorial is really superb for the peoples whao are new to JBoss. Really Excellent." V.L., December 7, 2006 "This works awesome. great for a start on JBoss!!" A., November 30, 2006 "Wonderful article, and it is no time waste info. Cool." S., October 31, 2006 "Fun ... Tastic, that's something that is not explained in the jboss tutorial, not like this anyway ;-)" O., September 12, 2006 "Cool! Very very nifty!&nbs; Excatly what I wanted. Thanks" B., September 12, 2006 "Awesome Tutorial! Just what the doctor ordered :)" L., August 31, 2006 "Great first step in learning development using JBoss" V.M., August 31, 2006 "This is cool... Thanx" M., August 14, 2006 "Cool! Exactly what I needed!" A., August 13, 2006 "Thanks a lot! This very informative and simple for newbies like me." P., July 29, 2006 "Thank you very much for this sample. It's a perfect self-contained application that I needed to fit all the pieces together and get started!" S.K., June 29, 2006 "Wow, this is greate information for beginners. I surffed many sites but didnt get exact way to deploy application. From this site i got what i wanted. I appriciate it. Thanks a lot!!!" H., June 26, 2006 "This is way too cool. I mean this is exactly the kind of thing I've been looking for. Thanks for the great work" S.E., June 3, 2006 "Great Article" S.A., May 24, 2006 "Really this article is amazing. Excellent!!!" P.S., May 6, 2006 "i have been crazy for last few days and this article saved me going mad. EXCELLENT WORK!!!!!" J., March 26, 2006 "That's an absolutely incredible tutorial. Super stuff !!" K.S.M., March 24, 2006 "simply superb." P.G.P., March 16, 2006 "Great guide. Thanks, it was very helpful." D.N., March 5, 2006 "It's really that simple ! I've wasted weeks looking at 'official' documentation - thank you for making my job easier !" P.G., January 30, 2006 "Your site really helped me. As a beginner in using JBoss i surfed through many sites to know how to get a JSP file executed. Thank you!" T.T., January 25, 2006 "Thanks very helpful." N., January 24, 2006 "This is really great article. I dont know anything about JBOSS. in 15 min i wrote program and saw the output." R.T., January 19, 2006 "EXCELLENT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" I., January 12, 2006 "really neat, easy to understand, thanks a lot, great stuff for beginners" J.M., January 12, 2006 "Thanks a lot, this was what I was looking for." S.B., January 11, 2006 "That was Excellent. It was the first time that I used JBoss. And You made it easy for me. Keep it up." D.K., January 9, 2006 "These steps are very good." B., January 6, 2006 "Thanks a lot for this concise reference on jsp deployment on JBoss." A., December 30, 2005 "Thanks -- simple but great work" M.S., December 29, 2005 "Hi, This is nice coding and helped me a lot to understand the process. Thank you very much." M.J., December 20, 2005 "This was EXACTLY what I needed; a super quick example of deploying an app to JBoss. Thanks a ton!" T., December 13, 2005 "It is very simple, good" M.K., December 12, 2005 "That was quick!! Thanks." G., December 9, 2005 "Thansk a bunch for the help. this was simple and very informative. it will help beginners a lot." J.A., November 27, 2005 "exceptionally simple for beginners" G.S., November 18, 2005 "Its very nice. Helpfull to every one for the beginers to jboss with jsp. Its simply gr8." P.I., November 16, 2005 "Great it seems simple when somebody shows you." M., November 14, 2005 "Simply Superb. Good Guide for beginners. Thanks a lot." R., November 10, 2005 "Thanks a lot. this was very helpful." S., November 9, 2005 "Thanks a lot for this example straight forward and clear." Anonymous, November 6, 2005 "Excellent example! Thanks!" F., November 3, 2005 "thank you. this was really helpfull" S.H., October 31, 2005 "Excellent HelloWorld! Thanks buddy" Anonymous, October 24, 2005 "At last - a really simple JBOSS jsp example" M.H., October 24, 2005 "If only all quick guides were as simple and as easy to follow. Thanks!" G.M., October 18, 2005 "its really nice for a begginer." V.N., October 17, 2005 "Hi, This is the nice coding and helped me a lot to understand the process." V.S.K., October 9, 2005 "Thank you very much. Your site helped me in the deployment part..." P.M., October 2, 2005 "really grrrrrrrrrrrrrrrrr8 i learned deployment concept sooon thanx" L.B., September 21, 2005 "Thanks for the wonderful example ... it makes it appear so simple!" R., September 20, 2005 "You made my day" S., September 9, 2005 "Great 10 steps, you have saved me so much time to be able to deploy my first jsp file on Jboss" I., August 18, 2005 "I think it cannot be explained in any other way. so tough but explained so simply. Thanks a lot" M.P., August 17, 2005 "Thanks for your very useful notes for jboss server, here i took only half an hour its sucessfully running. thanks for your easy notes. Everyone can easily read and understand these notes. its very useful for all kinds of java developers." G., August 17, 2005 "thanx alot.... i searched lots of things for simple example to run in jboss... this example made a smooth start... thanx Again" P., July 28, 2005 "Wow, even I got it running ;)" Anonymous, July 21, 2005 "Thanx ...Its really painful to look for a solution otherwise.....This is really simple" V., July 18, 2005 "Great Start, Thanks" M.S.C., June 30, 2005 "Really a Fantastic Basic Way to Deploy..Thanx" T.A., June 24, 2005 "This is the good hello world" K.S., June 14, 2005 "Very Helpful for a starter. One feels very confident when your application works the first time" S.H., May 27, 2005 "Very clear and very helpful." Anonymous, May 23, 2005 "Very useful for a fresher" S., April 30, 2005 "thank you, that was very helpfull :-D" R., April 29, 2005 "Thank you very much for your clear and crisp steps to deploy a web-applicatin in JBoss. I am greatful to you for this support..." E., April 27, 2005 "Thanks, that was a great tutorial for a beginner to JBoss like myself. It's really helped, thank you!!" K.D., April 24, 2005 "This is wonderful. Thanks a lot" B.C., April 10, 2005 "Exactly what was needed. Thank you very much." R.B., April 8, 2005 "Cool article! The only suggestion is... Use jar..." S.G.V., March 17, 2005 Excellent suggestion, implemented March 18. -- Dem "It's really simple and useful for beginner." A., March 15, 2005 "Thank You So Much. Short and Sweet" A.S., March 14, 2005 "strait to the point. ideal for quick hand-take. Thanx!" M.L., March 11, 2005 "Thank you! This is useful." S., March 8, 2005 "Hey! It is really simple :)))) Thanks a lot!" M.G., February 24, 2005 "Simple and sweet - thanks!" C.P., February 20, 2005 "Thank you!!! i have to change a few thing to make it work on linux but now I finally have my Hello world" V., February 15, 2005
|
||||||
![]() |
![]() |
|||||