JSP获取值

时间:2013-03-11 13:17:39

标签: jsp servlets

我只想获取String传递的值然后放入<p></p>。怎么做?

<% if(request.getParameter("status") != null) { %>
        <% if(request.getParameter("status").equals("ok")) { 
            String pass = request.getParameter("pass");%>
            <p>put the value of pass here in this line</p>
        <% } %>
    <% } %>

2 个答案:

答案 0 :(得分:0)

使用下面的代码更改段落行

<p><%= pass%></p>

答案 1 :(得分:0)

使用JSTL

<c:out value="${pass}" />

使用scriptlet(不太喜欢)

<%= pass %>