<!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>
Remarque :
<?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>