如何阻止jsp标记显示默认的空消息?

时间:2019-01-06 05:42:35

标签: jsp servlets jsp-tags

这是jsp页面registration_of_an_user.jsp

TreeMap[A, B]

这是控制器部分。

val leavesValues = leaves.collect {
  case leaf: Leaf => leaf.value.toDouble
}.to(ListBuffer)

无论何时运行registration_of_an_user.jsp,它都会在该段落标记的位置显示空消息。如果可以避免此消息显示默认值,那就太好了。我怎样才能做到这一点?我可以从控制器部分执行此操作,还是应该为此使用Java脚本?非常感谢您对此的建议。

1 个答案:

答案 0 :(得分:0)

只需将您的<p>..</p>放在里面即可。

<div id="container">

    <form action="User_Controller_Servlet" method="POST">

        <input type="hidden" name="command" value="REGISTRATION_OF_AN_USER" />

        <table>

            <tbody>

                <tr>
                    <td><label>User name</label></td>
                    <td><input type="text" name="u_name"></td>
                </tr>

                <tr>
                    <td><label>User email</label></td>
                    <td><input type="text" name="u_email"></td>
                </tr>

                <tr>
                    <td><label></label></td>
                    <td><input type="submit" value="Register"></td>
                </tr>

            </tbody>

        </table>
         <%if(request.getAttribute("message")!=null){ %>

            <p><%=request.getAttribute("message")%></p>
         <% } %>

    </form>

请回复

相关问题