我估计以下这两个语句有问题,不知道应该怎么修改,请高人指导!!
<%String num=request.getParameter("num"); %>
<%@ include file="include.jsp?=<%=num %>" %>tomcat提示:
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /ourter.jsp(27,5) File "/include.jsp?=<%=num %>" not found
<%String num=request.getParameter("num"); %>
<%@ include file="include.jsp?=<%=num %>" %>tomcat提示:
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /ourter.jsp(27,5) File "/include.jsp?=<%=num %>" not found
get方法提交,应该是键值对。
这样的页面,所以就出错了。
<%String num=request.getParameter("num"); %>
<%@ include file="include.jsp?v1=<%=num %>" %>严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /ourter.jsp(27,5) File "/include.jsp?v1=<%=num %>" not found
<%<%%>%>
这样写是不正确的。
<%@ include file="include.jsp?= <%=num %>" %> 看不出来你这个什么意思。。
你这句话在<%=num %>前面不应该有空格的。
而且你是传值,你传值应该这样写:<%@ include file="include.jsp?num=<%=num %>" %>
<%@ include file="include.jsp?v1= <%=num %>" %> 中的num是没有定义的,所以他就会报错。
如果你想进行传值引入其他页面的话可以用<jsp:include page="include.jsp"/>
<jsp:include page="include.jsp?v1=<%=num%>"%>