Jakarta EE Programming/Jakarta Server Pages

Here is a minimalist tutorial to create a JSP using Eclipse.


 * 1) If you have not already installed Eclipse, read this page.
 * 2) If you have not already installed an application server, read this page.
 * 3) Launch Eclipse
 * 4) On the Project Explorer view, right-click and select New -> Other...
 * 5) Select Web -> Dynamic Web project.
 * 6) Type helloworld for the Project name.
 * 7) On Target runtime, make sure that you have selected your application server instance.
 * 8) Click on Finish.
 * 9) Double-click on your new project to open it.
 * 10) Right-click on the folder WebContent.
 * 11) Select New -> JSP File.
 * 12) On File name, type  . It will be the name of your JSP.
 * 13) Click on Finish . The new   file should appear in the folder WebContent.
 * 14) Locate the text   in the new JSP file.
 * 15) After this text, write.
 * 16) Right-click on the folder WebContent/WEB-INF.
 * 17) Select New -> File.
 * 18) On File name, type  . This file is used to link our JSP with a URL in order to access to it. It can map many other things.
 * 19) Click on Finish.
 * 20) Double-click on the new file to open it.
 * 21) In the file, write the following content:



firstpage /FirstPage.jsp

 firstpage /firstpage 


 * 1) Right-click on the project.
 * 2) Select Export -> WAR file . If you don't find the option WAR file, click on Export... instead, select Web -> WAR file and click on Next >. The web project should be named.
 * 3) Choose a location for the destination. It's the folder where your application containing your JSP will be created. Remember this location.
 * 4) Click on Finish.
 * 5) Go on the folder where you have created your application. You should see a file named.
 * 6) Copy/paste your WAR file in the deployment folder of your application server.
 * 7) Start your application server.
 * 8) On a browser, go on  . You should see "Hello World!".

On the URL, helloworld comes from the name of the WAR file we have created and firstpage comes from the markup  in the   file.