JSP using MyEclipse IDE

JSP Web Application Development using MyEclipse IDE

In this article, I am going to show you the step-by-step process to create and run the JSP Web Application using the MyEclipse IDE. Please read our previous article where discussed JSP Web Application Development using Eclipse IDE. MyEclipse is a commercially available Java EE IDE created and maintained by the company Genuitec, a founding member of the Eclipse Foundation. MyEclipse is built upon the Eclipse platform and integrates both proprietary and open-source code into the development environment.

Download MyEclipse from https://www.genuitec.com/products/myeclipse/download/

JSP Web Application Development using MyEclipse IDE:

In this, we will create a simple JSP file and run it on MyEclipse IDE using Apache Tomcat Server. Follow the below steps to create the servlet in the MyEclipse IDE:

Step-1: Create a Web Project

Open MyEclipse IDE and then select File -> New -> Web Project option from the context menu as shown in the below image.

JSP Web Application Development using MyEclipse IDE

It will open the New Web Project window. From this window provide the project name as “HelloWorldJSP” (you can give any name as per your choice). Provide the necessary project configuration and finally click on the “Next” button as shown in the below image.

JSP Web Application using MyEclipse IDE

Once you click on the “Next” button, it will open the following window and here you simply click on the Next button as shown below.

JSP using MyEclipse IDE

Once you click on the Next button, it will open the Web Module window. Here, you need to check the “Generate web.xml deployment descriptor” checkbox and click on the “Finish” button as shown in the below image.

JSP Application Development using MyEclipse IDE

Step-2: Creating JSP Page

In order to create a JSP Page, right-click on the project, then select the New -> Other option as shown in the below image.

Creating JSP Page using MyEclipse IDE

It will open the Select a Wizard window. Here, type “jsp” and search and then select “JSP (Basic Templates)” and click on the “Next” button as shown in the below image.

Creating JSP Page using MyEclipse IDE

Once you click on the Next button, it will open Create a new JSP file window. Here, enter the file name as “HelloWorld.jsp” and then click on the “Finish” button as shown in the below image.

Creating JSP Page using MyEclipse IDE

Once you click on the “Finish” button a JSP page will create automatically with the following code.

Creating JSP Page using MyEclipse IDE

Now, modify HelloWorld.jsp file as shown below and save it (Ctrl+S).

<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title></title>
 <meta http-equiv="pragma" content="no-cache">
 <meta http-equiv="cache-control" content="no-cache">
 <meta http-equiv="expires" content="0">    
 <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
 <meta http-equiv="description" content="This is my page">
 <!--
 <link rel="stylesheet" type="text/css" href="styles.css">
 -->
  </head>
  
  <body>
    <%="Hello World!"%>   
  </body>
</html>
Step-3: Run your JSP Code

Now select the server to run the code on the browser as shown below. Make sure to already install any server on the system.

Run JSP Code using MyEclipse

Choose the Tomcat Server and click “Next” as shown below.

Run JSP Application using MyEclipse

If allowed by the server connector, you can indicate either exploded or packaged deployment by using the drop-down list beside the module in the Configured column. Finally, click on the “Finish” button as shown in the below image.

Run JSP Web Application using MyEclipse

The eclipse will open a browser and your server-side JSP code will print “Hello world!” in the browser.

JSP Web Application using the MyEclipse IDE

In the next article, I am going to show you the step-by-step process to create and run the JSP Web Application using NetBeans IDE. Here, in this article, I try to explain the step-by-step process to create and run the JSP Web Application using the MyEclipse IDE. I hope you enjoy this JSP using the MyEclipse IDE article.

Leave a Reply

Your email address will not be published.