| 编程中国 | 业界新闻 | 技术文章 | 视频教程 | 下载频道 | 程序源码 | 个人空间 | 编程论坛
全能ASP/PHP/ASP.NET主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付买域名,送MP3、MP4
高端软件开发 = 年薪十万不是梦赛孚耐:软件保护加密专家身份认证令牌USB KEY买空间,免费送域名(厦门中资源)
共有 255 人关注过本帖
标题:c:if标签使用问题
收藏  订阅  推荐  打印 
mahayu
Rank: 2
等级:注册会员
帖子:101
积分:1116
注册:2007-8-3
c:if标签使用问题

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!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=UTF-8">
<title>Insert title here </title>
</head>
<body>
<c:if test="${pageContext.request.method=='post'}">
<c:choose>
<c:when test="param.favor=='computer'">
Fav is <b>computer </b>
</c:when>
<c:otherwise>
Fav is <b>other </b>
</c:otherwise>
</c:choose>
</c:if>
<form method="post">
What?
<br>
<input type="text" name="favor">
<input type="submit" value="提交">
</form>
</body>
</html>

这段代码运行后,在文本框中输入任何值都没反应,红色部分提示:"Invalid character constant",请教如何解决?
2008-8-2 16:03
关于我们 | 广告合作 | 编程中国 | 清除Cookies | Archiver | WAP | TOP

编程中国 版权所有,并保留所有权利。鲁ICP备08000592号
Powered by Discuz, Processed in 0.050857 second(s), 9 queries.
Copyright©2004-2008, BCCN.NET, All Rights Reserved