You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Terje Kristensen <Te...@igroup.no> on 2001/05/30 09:30:10 UTC
Why doesn't this work:
Could anyone tell my why the <jsp:include doesn't work? I'm getting an 500
error.
<%
String opn = request.getParameter("opn");
Enumeration paramNames = request.getParameterNames();
while(paramNames.hasMoreElements()) {
String paramName = (String)paramNames.nextElement();
String[] paramValues = request.getParameterValues(paramName);
if (paramValues.length == 1) {
String paramValue = paramValues[0];
if (paramValue.length() == 0) {
%>error<%
}
} else {
for(int i=0; i<paramValues.length; i++) {
int length = paramValues[i].length();
String fil = "advanced_result_" + paramName +
".jsp";
%>
<jsp:include page="<%= fil %>" flush="true">
<jsp:param name="opn" value="<%= opn
%>"/>
<jsp:param name="<%= paramName %>"
value="<%= paramValues[i].substring(1,length) %>"/>
<jsp:param name="<%= paramName %>R"
value="<%= paramValues[i].substring(0,1) %>"/>
</jsp:include>
<%
}
}
} %>
If I remove the < in jsp:include, the text comes out all perfect:
jsp:include page="advanced_result_PCS.jsp" flush="true">
jsp:param name="opn" value="3"/>
jsp:param name="PCS" value="AC10A"/>
jsp:param name="PCSR" value="A"/>
/jsp:include>
jsp:include page="advanced_result_PCS.jsp" flush="true">
jsp:param name="opn" value="3"/>
jsp:param name="PCS" value="AC20A"/>
jsp:param name="PCSR" value="A"/>
/jsp:include>
Thanks,
Terje K.