- This topic has 2 replies, 1 voice, and was last updated 18 years, 10 months ago by
biiasuo.
-
AuthorPosts
-
biiasuoMemberhi,i am developing a web project.Myeclipse has already added standard.jar and jstl.jar to my project when i set up this project.
But when using “import tag”,i can see nothing to be included in this jsp file,from the the “preview tag”.however, if i put the code directly in the jsp file,instead of in my txt file,the page looks OK.why? (the jsp file and the txt file are both in the “webroot”) thx!
here is my jsp file:<%@ page language=”java” import=”java.util.*” pageEncoding=”gb2312″%>
<%@ taglib prefix=”c” uri=”http://java.sun.com/jsp/jstl/core” %>
<%
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>My JSP ‘bookmain.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 bgcolor =green>
<c:import url=”head.txt” />
<h1 align=center>welcome</h1></body>
</html>
biiasuoMemberhere is my txt file:
<table align=”center” border=”0″ width=”740″ height=”18″ bgcolor=yellow cellspacing=”1″>
<tr>
<td width=”100%”>
<c:url var=”localurl1″ value=”showBookList.jsp” />
<a href=”${localurl1}”>one</a><c:url var=”localurl2″ value=”userRegister.jsp” />
<a href=”${localurl2}”>two</a><c:url var=”localurl3″ value=”userLogin.jsp” />
<a href=”${localurl}”>three</a><c:url var=”localurl4″ value=”buybook.jsp” />
<a href=”${localurl}”>four</a><c:url var=”localurl5″ value=”modifyForm.jsp” />
<a href=”${localurl5}”>five</a><c:url var=”localurl6″ value=”showOrderForm.jsp” />
<a href=”${localurl6}”>six</a><c:url var=”localurl7″ value=”modifyPassword.jsp” />
<a href=”${localurl7}”>seven </a><c:url var=”localurl8″ value=”modifyMessage.jsp” />
<a href=”${localurl8}”>eight</a></tr>
</table>
biiasuoMemberhelp.thans a lot
-
AuthorPosts