{"id":12035,"date":"2014-07-25T15:30:21","date_gmt":"2014-07-25T12:30:21","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=12035"},"modified":"2014-07-25T15:20:01","modified_gmt":"2014-07-25T12:20:01","slug":"eclipse-jsp-editor-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/","title":{"rendered":"Eclipse JSP Editor Example"},"content":{"rendered":"<p>In this example, we will learn to use the JSP Editor available through the Web Tools Platform (WTP) within Eclipse.<\/p>\n<p><a href=\"http:\/\/www.oracle.com\/technetwork\/java\/javaee\/jsp\/index.html\" title=\"JavaServer Pages\" target=\"_blank\">JavaServer Pages (JSP)<\/a> technology, (part of Java Enterprise Edition &#8211; JEE), provides a simplified way for rapid development of web-based applications that are server- and platform-independent. It helps <b>Java<\/b> developers to create dynamically generated web pages based on HTML, XML, or other document types with embedded java code through scriplets.<\/p>\n<p>JSP contains the <a href=\"https:\/\/jstl.java.net\/\" title=\"JSP Standard Tag Library\" target=\"_blank\">JSP Standard Tag Library<\/a> (JSTL), which is a collection of tag libraries that implement general-purpose functionality common to many Web applications.<\/p>\n<p>The JSP editor provides a number of compelling features to ease JSP Development within eclipse. <\/p>\n<h2>Validate the editor availability<\/h2>\n<p>The first step is to validate whether the JSP editor is available for your Eclipse Installation. If you have already installed Eclipse IDE for Java EE Developers, you may skip the section below.<\/p>\n<p>Go to Menu &#8211;&gt; Window &#8211;&gt; Preferences.<\/p>\n<p>Browse to Web &#8211;&gt; JSP Files &#8211;&gt; Editor<\/p>\n<p><figure id=\"attachment_12160\" aria-describedby=\"caption-attachment-12160\" style=\"width: 645px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/EditorAvailability.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/EditorAvailability.jpg\" alt=\"JSP Editor availability\" width=\"645\" height=\"685\" class=\"size-full wp-image-12160\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/EditorAvailability.jpg 645w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/EditorAvailability-282x300.jpg 282w\" sizes=\"(max-width: 645px) 100vw, 645px\" \/><\/a><figcaption id=\"caption-attachment-12160\" class=\"wp-caption-text\">JSP Editor availability<\/figcaption><\/figure><\/p>\n<p>In case, you do not find Web under Preferences, you may need to go back and install the Web Tools Platform (WTP) in your eclipse. The WTP is available by default for Eclipse 4.3 JEE and above. For versions prior to 4.3, please follow the New Software Installation instructions <a href=\"http:\/\/help.eclipse.org\/indigo\/index.jsp?topic=\/org.eclipse.platform.doc.user\/tasks\/tasks-129.htm\" title=\"here\" target=\"_blank\">here<\/a><\/p>\n<p>The update site repository links for webtools for specific eclipse releases can be found <a href=\"http:\/\/download.eclipse.org\/webtools\/updates\/\" title=\"here\" target=\"_blank\">here<\/a><\/p>\n<h2>Features of the JSP Editor<\/h2>\n<p>The JSP Editor provides some great features to ease JSP development like searching, templating, encoding, code\/content assists, syntax coloring, code typing and validations. <\/p>\n<ol>\n<li>General Options for JSP<\/li>\n<p>As seen below, the first option specifies default file extensions while you create a new JSP file. There is also an option to select the default encoding and whether (or not) to include JSP files for text searches.<\/p>\n<p><figure id=\"attachment_12173\" aria-describedby=\"caption-attachment-12173\" style=\"width: 686px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin1_u.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin1_u.jpg\" alt=\"JSP Editor - Basic Options\" width=\"686\" height=\"682\" class=\"size-full wp-image-12173\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin1_u.jpg 686w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin1_u-150x150.jpg 150w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin1_u-300x298.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin1_u-200x200.jpg 200w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin1_u-100x100.jpg 100w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin1_u-42x42.jpg 42w\" sizes=\"(max-width: 686px) 100vw, 686px\" \/><\/a><figcaption id=\"caption-attachment-12173\" class=\"wp-caption-text\">JSP Editor &#8211; Basic Options<\/figcaption><\/figure><\/p>\n<li>Content Assist<\/li>\n<p>Here, one can customize the content assist in the JSP editor. The options include enabling and prioritizing proposal categories on shortcuts for code auto-complete using (Ctrl + space) command. As screen below, we have changed the priority of JSP Template proposals to the first one before HTML templates.    <\/p>\n<p><figure id=\"attachment_12038\" aria-describedby=\"caption-attachment-12038\" style=\"width: 625px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin2.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin2.jpg\" alt=\"JSP Editor - Content Assist\" width=\"625\" height=\"580\" class=\"size-full wp-image-12038\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin2.jpg 625w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin2-300x278.jpg 300w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/a><figcaption id=\"caption-attachment-12038\" class=\"wp-caption-text\">JSP Editor &#8211; Content Assist<\/figcaption><\/figure><div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<li>Syntax coloring<\/li>\n<p>In this option, one can edit the color of the code in the editor.<\/p>\n<p><figure id=\"attachment_12039\" aria-describedby=\"caption-attachment-12039\" style=\"width: 627px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin3.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin3.jpg\" alt=\"JSP Editor - Syntax Color \" width=\"627\" height=\"581\" class=\"size-full wp-image-12039\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin3.jpg 627w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin3-300x277.jpg 300w\" sizes=\"(max-width: 627px) 100vw, 627px\" \/><\/a><figcaption id=\"caption-attachment-12039\" class=\"wp-caption-text\">JSP Editor &#8211; Syntax Color<\/figcaption><\/figure><\/p>\n<li>Create \/ Edit JSP Templates<\/li>\n<p>In this option, one can edit existing templates or create new ones. <\/p>\n<p><figure id=\"attachment_12040\" aria-describedby=\"caption-attachment-12040\" style=\"width: 763px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin4.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin4.jpg\" alt=\"JSP Editor - Templates\" width=\"763\" height=\"578\" class=\"size-full wp-image-12040\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin4.jpg 763w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin4-300x227.jpg 300w\" sizes=\"(max-width: 763px) 100vw, 763px\" \/><\/a><figcaption id=\"caption-attachment-12040\" class=\"wp-caption-text\">JSP Editor &#8211; Templates<\/figcaption><\/figure><\/p>\n<p>For this example, we will create a new template named &#8220;New JSP with JSTL&#8221; and have the template include the core JSTL library with the appropriate taglib prefix.<\/p>\n<p><figure id=\"attachment_12041\" aria-describedby=\"caption-attachment-12041\" style=\"width: 512px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin4_1.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin4_1.jpg\" alt=\"JSP Editor - Create new template\" width=\"512\" height=\"322\" class=\"size-full wp-image-12041\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin4_1.jpg 512w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin4_1-300x188.jpg 300w\" sizes=\"(max-width: 512px) 100vw, 512px\" \/><\/a><figcaption id=\"caption-attachment-12041\" class=\"wp-caption-text\">JSP Editor &#8211; Create new template<\/figcaption><\/figure><\/p>\n<li>Typing and Validation<\/li>\n<p>Finally, as part of the JSP Editor, one can set-up any of the code typing properties and classify incorrect code to be alerted as Error OR Warning in the editor.<\/p>\n<p><figure id=\"attachment_12042\" aria-describedby=\"caption-attachment-12042\" style=\"width: 633px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin5.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin5.jpg\" alt=\"JSP Editor - Validation\" width=\"633\" height=\"581\" class=\"size-full wp-image-12042\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin5.jpg 633w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPPlugin5-300x275.jpg 300w\" sizes=\"(max-width: 633px) 100vw, 633px\" \/><\/a><figcaption id=\"caption-attachment-12042\" class=\"wp-caption-text\">JSP Editor &#8211; Validation<\/figcaption><\/figure>\n<\/ol>\n<h2>JSP Editor in Action<\/h2>\n<p>After reviewing the editor features and configuration, let us know see the JSP editor in action.<\/p>\n<p>Create a new &#8220;Dynamic Web Project&#8221;. <\/p>\n<p>Go to Menu &#8211;&gt; New &#8211;&gt; Dynamic Web Project.<br \/>\n<i>Please select the appropriate webapp archetype in case you are creating a new Maven project.<\/i><\/p>\n<p>Once the web project is created, we can now create a new JSP file. Right click on the project context, and click New.<br \/>\nSelect JSP file and provide a name to the JSP File. Click <b>Next<\/b>.<\/p>\n<p><figure id=\"attachment_12043\" aria-describedby=\"caption-attachment-12043\" style=\"width: 553px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPCreation6.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPCreation6.jpg\" alt=\"New JSP File\" width=\"553\" height=\"560\" class=\"size-full wp-image-12043\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPCreation6.jpg 553w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPCreation6-296x300.jpg 296w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPCreation6-100x100.jpg 100w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPCreation6-42x42.jpg 42w\" sizes=\"(max-width: 553px) 100vw, 553px\" \/><\/a><figcaption id=\"caption-attachment-12043\" class=\"wp-caption-text\">New JSP File<\/figcaption><\/figure><\/p>\n<p>Select the new JSP Template &#8211; &#8220;New JSP with JSTL&#8221; as created in step 4 above.<\/p>\n<p><figure id=\"attachment_12044\" aria-describedby=\"caption-attachment-12044\" style=\"width: 611px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPCreation7.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPCreation7.jpg\" alt=\"New JSP File using Template\" width=\"611\" height=\"625\" class=\"size-full wp-image-12044\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPCreation7.jpg 611w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPCreation7-293x300.jpg 293w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPCreation7-42x42.jpg 42w\" sizes=\"(max-width: 611px) 100vw, 611px\" \/><\/a><figcaption id=\"caption-attachment-12044\" class=\"wp-caption-text\">New JSP File using Template<\/figcaption><\/figure><\/p>\n<p><b><i>Notice the include for the JSTL Core in the new created JSP as per our template created in Step 4 above.<\/i><\/b><br \/>\nYou can now press Ctrl + Space (and type jsp) to view the available source options for the Editor.<\/p>\n<p><figure id=\"attachment_12045\" aria-describedby=\"caption-attachment-12045\" style=\"width: 677px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/Editor8.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/Editor8.jpg\" alt=\"JSP Editor - code assist in the editor\" width=\"677\" height=\"516\" class=\"size-full wp-image-12045\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/Editor8.jpg 677w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/Editor8-300x228.jpg 300w\" sizes=\"(max-width: 677px) 100vw, 677px\" \/><\/a><figcaption id=\"caption-attachment-12045\" class=\"wp-caption-text\">JSP Editor &#8211; code assist in the editor<\/figcaption><\/figure><\/p>\n<p>Let us know, use the content assist in the editor and create the following:<\/p>\n<ul>\n<li>JSP Declaration<\/li>\n<p>Here, we will define a static method <code>getWelcomeMessage<\/code> which returns a String.<\/p>\n<li>JSP Expressions<\/li>\n<p>The expression would invoke the static method to display the message as an evaluated expression.<\/p>\n<li>JSP Scriplets<\/li>\n<p>The JSP Scriplet is where we can write Java code within the JSP. For our example, we will print out some message to the jsp writer. <\/p>\n<li>JSP Use bean tag<\/li>\n<p>Here, we will create a sample bean named <code>SamplePersonBean<\/code> which has only one String variable <code>personName<\/code>. We will use this bean in JSP through <code>useBean<\/code> tag and set the personName property and retrieve it.\n<\/ul>\n<p><span style=\"text-decoration: underline\"><em>EditorTest.jsp<\/em><\/span><\/p>\n<pre class=\"brush:java\">\r\n&lt;%@ taglib prefix=\"c\" uri=\"http:\/\/java.sun.com\/jsp\/jstl\/core\"%&gt;\r\n&lt;%@ page language=\"java\" contentType=\"text\/html; charset=UTF-8\"\r\n\tpageEncoding=\"UTF-8\"%&gt;\r\n\t&lt;%@ page import=\"com.javacodegeeks.jspeditor.SamplePersonBean\" %&gt;\r\n&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/html4\/loose.dtd\"&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=UTF-8\"&gt;\r\n&lt;title&gt;Java Code check - JSP Editor Plugin&lt;\/title&gt;\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\t&lt;%-- JSP Declaration --%&gt;\r\n\t&lt;%! private static String getWelcomeMessage() {\r\n\t\treturn \"Hello JSP Editor Plugin\";\r\n\t}%&gt;\r\n\t\r\n\t&lt;%-- JSP Expressions --%&gt;\r\n\t&lt;h2&gt;\r\n\t&lt;%=  getWelcomeMessage()%&gt; \r\n\t&lt;\/h2&gt;\r\n\t\r\n\t&lt;%-- JSP Scriplets --%&gt;\r\n\t&lt;% int i=-1; %&gt;\r\n\t\r\n\t&lt;%-- JSP Use Bean example --%&gt;\r\n\t&lt;jsp:useBean id=\"samplePerson\" class=\"com.javacodegeeks.jspeditor.SamplePersonBean\" scope=\"page\"&gt;&lt;\/jsp:useBean&gt;\r\n\t&lt;jsp:setProperty name=\"samplePerson\" property=\"personName\" value=\"Java Code Geeks\" \/&gt;\r\n\t\r\n\t&lt;h3&gt; - By &lt;jsp:getProperty property=\"personName\" name=\"samplePerson\"\/&gt;\r\n\t&lt;\/h3&gt;\r\n\t\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p><span style=\"text-decoration: underline\"><em>SamplePersonBean.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">\r\npackage com.javacodegeeks.jspeditor;\r\n\r\npublic class SamplePersonBean {\r\n\r\n\tprivate String personName;\r\n\r\n\tpublic String getPersonName() {\r\n\t\treturn personName;\r\n\t}\r\n\r\n\tpublic void setPersonName(String personName) {\r\n\t\tthis.personName = personName;\r\n\t}\r\n}\r\n<\/pre>\n<p>Add the jsp as the Welcome file in the Deployment assembly for the project.<br \/>\n<span style=\"text-decoration: underline\"><em>web.xml<\/em><\/span><\/p>\n<pre class=\"brush:xml\">\r\n&lt;!DOCTYPE web-app PUBLIC\r\n \"-\/\/Sun Microsystems, Inc.\/\/DTD Web Application 2.3\/\/EN\"\r\n \"http:\/\/java.sun.com\/dtd\/web-app_2_3.dtd\" &gt;\r\n\r\n&lt;web-app&gt;\r\n  &lt;display-name&gt;JSP Editor Plugin&lt;\/display-name&gt;\r\n  &lt;welcome-file-list&gt;\r\n  &lt;welcome-file&gt;EditorTest.jsp&lt;\/welcome-file&gt;\r\n  &lt;\/welcome-file-list&gt;\r\n&lt;\/web-app&gt;\r\n<\/pre>\n<p>Run the application on an integrated Web server &#8211; Tomcat, and view the output in the browser.<\/p>\n<p><figure id=\"attachment_12155\" aria-describedby=\"caption-attachment-12155\" style=\"width: 586px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPEditorOutput.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPEditorOutput.jpg\" alt=\"JSP Editor Output\" width=\"586\" height=\"259\" class=\"size-full wp-image-12155\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPEditorOutput.jpg 586w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPEditorOutput-300x132.jpg 300w\" sizes=\"(max-width: 586px) 100vw, 586px\" \/><\/a><figcaption id=\"caption-attachment-12155\" class=\"wp-caption-text\">JSP Editor Output<\/figcaption><\/figure><\/p>\n<h2>Support for JSTL<\/h2>\n<p>The JSP Editor also provides content assist support for JSTL. As seen above, we have included the core JSTL. By typing &lt;c: and Ctrl + Space, the editor suggests the available tags under the JSTL core as shown below.<\/p>\n<p><figure id=\"attachment_12157\" aria-describedby=\"caption-attachment-12157\" style=\"width: 609px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/Editor9foreach1.jpg\"><img decoding=\"async\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/Editor9foreach1.jpg\" alt=\"JSP Editor - JSTL content assist\" width=\"609\" height=\"669\" class=\"size-full wp-image-12157\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/Editor9foreach1.jpg 609w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/Editor9foreach1-273x300.jpg 273w\" sizes=\"(max-width: 609px) 100vw, 609px\" \/><\/a><figcaption id=\"caption-attachment-12157\" class=\"wp-caption-text\">JSP Editor &#8211; JSTL content assist<\/figcaption><\/figure><\/p>\n<h2>Download the Eclipse Project<\/h2>\n<p>This was the example demonstrating use of JSP Editor in eclipse.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>You can download the full source code of this example here : <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/07\/JSPEditorExample.zip\"><b>JSPEditorExample.zip<\/b><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this example, we will learn to use the JSP Editor available through the Web Tools Platform (WTP) within Eclipse. JavaServer Pages (JSP) technology, (part of Java Enterprise Edition &#8211; JEE), provides a simplified way for rapid development of web-based applications that are server- and platform-independent. It helps Java developers to create dynamically generated web &hellip;<\/p>\n","protected":false},"author":20,"featured_media":1240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[1156,1030],"class_list":["post-12035","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jsp","tag-eclipse","tag-jsp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Eclipse JSP Editor Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In this example, we will learn to use the JSP Editor available through the Web Tools Platform (WTP) within Eclipse. JavaServer Pages (JSP) technology,\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Eclipse JSP Editor Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In this example, we will learn to use the JSP Editor available through the Web Tools Platform (WTP) within Eclipse. JavaServer Pages (JSP) technology,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2014-07-25T12:30:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Vishal Rajpal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vishal Rajpal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/\"},\"author\":{\"name\":\"Vishal Rajpal\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/12ed9c93288f688dbdbdcb1c46063530\"},\"headline\":\"Eclipse JSP Editor Example\",\"datePublished\":\"2014-07-25T12:30:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/\"},\"wordCount\":942,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg\",\"keywords\":[\"Eclipse\",\"jsp\"],\"articleSection\":[\"jsp\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/\",\"name\":\"Eclipse JSP Editor Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg\",\"datePublished\":\"2014-07-25T12:30:21+00:00\",\"description\":\"In this example, we will learn to use the JSP Editor available through the Web Tools Platform (WTP) within Eclipse. JavaServer Pages (JSP) technology,\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"jsp\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/jsp\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Eclipse JSP Editor Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/12ed9c93288f688dbdbdcb1c46063530\",\"name\":\"Vishal Rajpal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/Vishal-Rajpal-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/Vishal-Rajpal-96x96.jpg\",\"caption\":\"Vishal Rajpal\"},\"description\":\"Vishal enjoys designing and developing small and mid-sized Enterprise solutions in Java and it's ecosystem. He has graduated from RGTU, India in Electronics and Telecommunication Engineering. Currently, Vishal is working with an Analytics organization, enabling the in-house analytics as well as client teams to use technology as a differentiator for projects \/ problems related to Big Data.\",\"sameAs\":[\"http:\/\/www.javacodegeeks.com\/\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/vishal-rajpal\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Eclipse JSP Editor Example - Java Code Geeks","description":"In this example, we will learn to use the JSP Editor available through the Web Tools Platform (WTP) within Eclipse. JavaServer Pages (JSP) technology,","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/","og_locale":"en_US","og_type":"article","og_title":"Eclipse JSP Editor Example - Java Code Geeks","og_description":"In this example, we will learn to use the JSP Editor available through the Web Tools Platform (WTP) within Eclipse. JavaServer Pages (JSP) technology,","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2014-07-25T12:30:21+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Vishal Rajpal","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Vishal Rajpal","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/"},"author":{"name":"Vishal Rajpal","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/12ed9c93288f688dbdbdcb1c46063530"},"headline":"Eclipse JSP Editor Example","datePublished":"2014-07-25T12:30:21+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/"},"wordCount":942,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg","keywords":["Eclipse","jsp"],"articleSection":["jsp"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/","name":"Eclipse JSP Editor Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg","datePublished":"2014-07-25T12:30:21+00:00","description":"In this example, we will learn to use the JSP Editor available through the Web Tools Platform (WTP) within Eclipse. JavaServer Pages (JSP) technology,","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/enterprise-java-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/enterprise-java\/jsp\/eclipse-jsp-editor-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/"},{"@type":"ListItem","position":4,"name":"jsp","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/enterprise-java\/jsp\/"},{"@type":"ListItem","position":5,"name":"Eclipse JSP Editor Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/12ed9c93288f688dbdbdcb1c46063530","name":"Vishal Rajpal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/Vishal-Rajpal-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/06\/Vishal-Rajpal-96x96.jpg","caption":"Vishal Rajpal"},"description":"Vishal enjoys designing and developing small and mid-sized Enterprise solutions in Java and it's ecosystem. He has graduated from RGTU, India in Electronics and Telecommunication Engineering. Currently, Vishal is working with an Analytics organization, enabling the in-house analytics as well as client teams to use technology as a differentiator for projects \/ problems related to Big Data.","sameAs":["http:\/\/www.javacodegeeks.com\/"],"url":"https:\/\/examples.javacodegeeks.com\/author\/vishal-rajpal\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/12035","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=12035"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/12035\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/1240"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=12035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=12035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=12035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}