老师为什么我这里会报错呢?

老师为什么我这里会报错呢?

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>慕课网用户管理中心</title>
    <link rel="stylesheet" href="lib/bootstrap-3.3.7-dist/css/bootstrap.min.css">
    <script src="lib/2.2.4/jquery-1.12.4.min.js"></script>
    <script src="lib/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="page-header">
            <h1>慕课网后台管理系统
                <small>用户数据管理中心</small>
            </h1>
        </div>
    </div>
    <div class="row">
        <div class="jumbotron">
            <h1>Mybatis基础入门课程!</h1>
            <p>通过一个项目来完成基础部分的学习</p>
            <p><a href="#" class="btn btn-primary btn-lg" role="button">查看更多,请上慕课网</a></p>
        </div>
    </div>
    <c:set var="user" value="${user}">
        <div class="row">
            <div class="col-md-8 col-md-offset-2">
                <form class="form-horizontal">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">用户账号</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${user.username}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">登录密码</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">****</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="nickname" class="col-sm-2 control-label">昵称</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="nickname" name="nickname"
                                   value="${user.nickname}" placeholder="Password">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="age" class="col-sm-2 control-label">年龄</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="age" name="age" value="${user.age}"
                                   placeholder="Password">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="gender" class="col-sm-2 control-label">性别</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="gender" name="gender" value="${user.gender}"
                                   placeholder="Password">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="phone" class="col-sm-2 control-label">联系方式</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="phone" name="phone" value="${user.phone}"
                                   placeholder="Password">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="email" class="col-sm-2 control-label">邮箱</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="email" name="email" value="${user.email}"
                                   placeholder="Password">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">账号创建时间</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${user.createTime}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">最后修改时间</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${user.updateTime}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">最后登录时间</label>
                        <div class="col-sm-10">
                            <p class="form-control-static">${user.lastLogin}</p>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">用户状态</label>
                        <div class="col-sm-10">
                            <c:if test="${user.userStatus==0}">
                                <p class="form-control-static">正常</p>
                            </c:if>
                            <c:if test="${user.userStatus==1}">
                                <p class="form-control-static">锁定</p>
                            </c:if>
                            <c:if test="${user.userStatus==2}">
                                <p class="form-control-static">删除</p>
                            </c:if>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="remark" class="col-sm-2 control-label">备注</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="remark" value="${user.remark}" name="remark"
                                   placeholder="Password">
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </c:set>
</div>
</body>
</html>

http://img1.sycdn.imooc.com//climg/5d033a7a00015cc619291039.jpg

正在回答

登陆购买课程后可参与讨论,去登陆

3回答

       同学你好,<c:set>标签用于设置变量值和对象属性。用法就是这样定义的哦,同学这里记住即可。

       如果我的回答解决了你的疑惑,请采纳。祝:学习愉快~

提问者 MasonM 2019-06-14 15:49:09

http://img1.sycdn.imooc.com//climg/5d0350f3000140b310560417.jpg

我把<c:set></c:set>改成这样才行,因为一开始,习惯性把这个标签包裹下面的内容了

能解释一下吗,为什么这里的<c:set></c:set>不需要像<c:forEach></c:forEach>那样需要遍历的内容呢?

  • 提问者 MasonM #1
    上面有句话打错了 为什么这里的<c:set></c:set>不需要像<c:forEach></c:forEach>那样需要包裹遍历的内容呢?我的意思是,<c:set></c:set>的作用是什么呢? 为什么不需要包裹下面的表情内容(用户名,昵称那些东西)
    2019-06-14 15:51:24
吃吃吃鱼的猫 2019-06-14 15:44:02

同学你好,在taglib与@之间添加一个空格后再进行测试。

http://img1.sycdn.imooc.com//climg/5d0350180001ae8804520038.jpg

如果我的回答解决了你的疑惑,请采纳。祝:学习愉快~

  • 提问者 MasonM #1
    老师我发现问题在哪了,好像不是这个问题,是因为我把<c:set></c:set>中间包裹了其他东西,就报错了,我也不知道为什么请看新回答
    2019-06-14 15:46:26
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师