小编Ali*_*t3r的帖子

jquery.validate:无法读取null的属性"nodeType"

我有这个小注册表

<h2>Please Register Your Account</h2>
                <div class="form-horizontal" id="idFormRegistrazione">
                    <div class="form-group">
                        <label id="labelUsername" for="idUsername" class="col-sm-2 col-xs-2 control-label">Username*</label>
                        <div class="col-sm-10 col-xs-10">
                            <input type="text" class="form-control" id="idUsername" placeholder="Username" name="username">
                        </div>
                    </div>
                    <div class="form-group">
                        <label id="labelName" for="idName" class="col-sm-2 col-xs-2 control-label">Name</label>
                        <div class="col-sm-10 col-xs-10">
                            <input type="text" class="form-control" id="idName" placeholder="Name" name="name">
                        </div>
                    </div>
                    <div class="form-group">
                        <label id="labelSurname" for="idSurname" class="col-sm-2 col-xs-2 control-label">Surname</label>
                        <div class="col-sm-10 col-xs-10">
                            <input type="text" class="form-control" id="idSurname" placeholder="Surname" name="surname">
                        </div>
                    </div>
                    <div class="form-group">
                        <label id="labelEmail" for="idEmail" class="col-sm-2 col-xs-2 control-label">E-mail*</label>
                        <div class="col-sm-10 col-xs-10">
                            <input type="text" class="form-control" id="idEmail" …
Run Code Online (Sandbox Code Playgroud)

jquery jquery-validate

5
推荐指数
1
解决办法
1万
查看次数

在 spring/mvc 中,在 jsp 页面中的“模型”上使用 if-then-else 语句

我在我的 servlet 中有这个方法:

@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {

    Map<String, Object> myModel = new HashMap<String, Object>();

    [...do something...]

    model.put("msg","a message");

    return new ModelAndView("myPage", "model", myModel);

}   
Run Code Online (Sandbox Code Playgroud)

现在在 myPage.jsp 中,我想在 ${model.msg} 上执行 if-then-else,并且我尝试以这种方式使用 JSTL:

        <c:choose>
            <c:when test="${!empty model.msg}">
                <p> not empty </p>
            </c:when>
            <c:otherwise>
                <p>empty</p>
            </c:otherwise>
        </c:choose>
Run Code Online (Sandbox Code Playgroud)

但我收到此警告和错误:“测试不支持运行时表达式”

我可以帮忙吗?谢谢

jsp jstl spring-mvc

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

jquery ×1

jquery-validate ×1

jsp ×1

jstl ×1

spring-mvc ×1