JSP Wizard

Lire cette page en français Go back

This wizard will generate a basic JSP file.

Warning: do not forget to add in your classpath the servlet.jar. In order to use this plugin you should install the Tomcat plugin (or a similar plugin).
A few information is needed:
  • Where to create the JSP file
  • The name of your JSP file, it should end with .jsp

  • In a second window you will have to specify mapping options:
  • The key name of your JSP
  • The URL that will lead to your JSP.
  • Where to find/create the web.xml file.
  • Finally you need to specify the template. If you want to know how to create your own template go here


  • This is an example of JSP generated:
                <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%@ page language="java" import="java.lang.*,java.util.*" %>
    <% 
    String path = request.getContextPath(); 
    String basePath = "http://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 
    %>
    <HTML>
      <HEAD>
        <BASE HREF="<%=basePath%>">
    
        <TITLE>My JSP 'MyJsp.jsp' starting page</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>
        This is my JSP page. <BR>
      </BODY>
    </HTML>
              

    And this is the web.xml file that was created:
                <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    
      <display-name>PutHereTheNameOfYourWebApp</display-name>
    
      <description>This a description of my web app made by Eclipse</description>
    
      <servlet>
        <servlet-name>MyJsp</servlet-name>
        <display-name>This is the display name of my J2EE component</display-name>
        <description>This is the description of my J2EE component</description>
        <jsp-file>/work/MyJsp.jsp</jsp-file>
      </servlet>
      <servlet-mapping>
        <servlet-name>MyJsp</servlet-name>
        <url-pattern>/MyJsp.jsp</url-pattern>
      </servlet-mapping>
      <welcome-file-list>
        <welcome-file>/MyJsp.jsp</welcome-file>
      </welcome-file-list>
    
    </web-app>
              


    Comments, ideas and bugs mail me at : Contact