eclipse - Why can not find the index.jsp in the web project with DD -
all, forgive me newbie in java web world, trying write web project test. seems didn't got result expected. don't know happen . please review .here done far.
- create dynamic web project named
myfirstweb
in eclipse optiongenerate web.xml dd
. - add
index.jsp
under directory ofwebcontent
.below page code in it.
<%@ page language="java" contenttype="text/html; charset=iso-8859-1" pageencoding="iso-8859-1"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>my title</title> </head> <body> <% java.util.date d = new java.util.date(); %> <h1> today's date <%= d.tostring() %> , jsp page worked! </h1> </body> </html>
and after published build-in tomcat server run-time in eclipse. there no error when server started. got empty page url http://localhost:8080/myfirstweb/index.jsp
, why? thanks.
well used exact code in eclipse , working fine. can post error is.? , check if web.xml has this
<?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="webapp_id" version="3.0"> <display-name>myfirstweb</display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
Comments
Post a Comment