我搭建了个struts项目,但是我进入注册页面的时候,为什么页面一片空白???请大牛帮忙解答!注册页面代码如下:<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
<head>
<base href="<%=basePath%>"> <title>注册页面</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>
<center>
<jsp:include flush="true" page="../inc/template.jsp" >
<jsp:param name="url" value="../"/>
</jsp:include>
<h1>用户注册</h1>
<html:form action="user.do" method="post">
用户ID:<html:text property="userid"></html:text>
<br />
密 码:<html:text property="userpwd"></html:text>
<br />
确认密码:<html:text property="confirmpwd"></html:text>
<br />
密码提示问题:<html:text property="userques"></html:text>
<br />
密码提示问题答案:<html:text property="userans"></html:text>
<br />
验证码: <html:text property="checkcode"></html:text><img src="image.jsp">
<br />
<input type="hidden" name="status" value="register" />
<input type="hidden" name="type" value="1" />
<html:submit value="注册"></html:submit>
<html:reset value="重置"></html:reset>
</html:form>
</center>
</body>
</html:html>
查看源代码如下:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="zh-CN">
<head>
<base href="http://localhost:8085/zhinangtuan/"> <title>注册页面</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>
<center>感觉标签不识别, 怎么解决???求教
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html:html lang="true">
<head>
<base href="<%=basePath%>"> <title>注册页面</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>
<center>
<jsp:include flush="true" page="../inc/template.jsp" >
<jsp:param name="url" value="../"/>
</jsp:include>
<h1>用户注册</h1>
<html:form action="user.do" method="post">
用户ID:<html:text property="userid"></html:text>
<br />
密 码:<html:text property="userpwd"></html:text>
<br />
确认密码:<html:text property="confirmpwd"></html:text>
<br />
密码提示问题:<html:text property="userques"></html:text>
<br />
密码提示问题答案:<html:text property="userans"></html:text>
<br />
验证码: <html:text property="checkcode"></html:text><img src="image.jsp">
<br />
<input type="hidden" name="status" value="register" />
<input type="hidden" name="type" value="1" />
<html:submit value="注册"></html:submit>
<html:reset value="重置"></html:reset>
</html:form>
</center>
</body>
</html:html>
查看源代码如下:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="zh-CN">
<head>
<base href="http://localhost:8085/zhinangtuan/"> <title>注册页面</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>
<center>感觉标签不识别, 怎么解决???求教
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%> <base href=" <%=basePath%>"> 以上代码去掉试试,什么都看不到,应该是路径问题
<jsp:include flush="true" page="../inc/template.jsp" >
<jsp:param name="url" value="../"/>
</jsp:include>
<jsp:include flush="true" page="../inc/template.jsp" >
<jsp:param name="url" value="../"/>
</jsp:include> 应该显示的是加载页面的内容。
在MyEclipse中,你输入<html:后,按alt+/后,看能不能自动出现提示
如果没有,说明加入标签库路径不对
你看看struts的库文件,找到METE_INF目录,打开相应的tld文件,看uri的路径吧
复制就可以了
<jsp:param name="url" value="../"/>
</jsp:include>
也不正确我不用stuts标签换成html就没问题
但是标签有那里有问题呢
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%> 你的是什么项目呀?为什么要这样写?你嫌项目访问速度快呀?把jar包和dtd文件放到自已项目中来,相信不会出什么错.