JSP包含基于URL查询

时间:2014-04-01 18:35:22

标签: jsp if-statement dynamic include conditional

我有一个网址为:

  

domain.com/page.jsp?pID=01

我有代码:

<% String pID; %> <% if (request.getParameter("pID") == "01") { %>
     <%@include file="page01.jsp" %>
             <% } else if (request.getParameter("pID") == "02"){ %>
     <%@include file="page02.jsp" %>
             <% } %>

我得到的只是一个空白页面。这是为什么?

0 个答案:

没有答案