我的jsp页面中有以下代码
<body>
<jsp:useBean id="ref" class="comp_Mps.Comp_Mps_hs"/>
<%
String s_date= request.getParameter("startdate");
pageContext.setAttribute("s_date", s_date);
String e_date= request.getParameter("enddate");
pageContext.setAttribute("e_date", e_date);
ref.refarray_vac1(s_date,e_date);
ref.ClosestToMultiplesOfTen_User(s_date,e_date);
%>
<%
String ref_name= request.getParameter("ref_logtime");
pageContext.setAttribute("ref_name", ref_name);
ref.FindClosestToMultiplesOfTen(ref_name);
ref.refernece(ref_name);
%>
现在我想将变量s_date,e_date和ref_name传递给另一个jsp页面。为此我做了代码
<jsp:include page="Comp_Mps_Hs.jsp?ref_logtime=<%=ref_name%>;&startdate=<%=s_date%>;&&enddate=<%=e_date%>"></jsp:include>
I want to pass above said variable sin Comp_Mps_Hs.jsp page.But when I run it ,then I get an error that
**
java.lang.IllegalArgumentException:[=]不是十六进制数字
** 如何在另一个jsp中传递这些变量?
答案 0 :(得分:1)
我使用param作为
<jsp:include page="Comp_Mps_Hs.jsp">
<jsp:param value="startdate" name="s_date"/>
<jsp:param value="enddate" name="e_date"/>
<jsp:param value="ref_logtime" name="ref_name"/>
</jsp:include>
答案 1 :(得分:1)
也许你可以试试这个,它与@tiddi rastogi提到的相似。
<jsp:include page="Comp_Mps_Hs.jsp">
<jsp:param name="ref_logtime" value="<%=ref_name%>" />
<jsp:param name="startdate" value="<%=s_date%>" />
<jsp:param name="enddate" value="<%=e_date%>" />
</jsp:include>