Sorry, but I'm not shure that I understand right.
To verify that I unstood well so far:
- Your code sniplet (info 2) is from the source
advanced_section_result.jsp
- info 1 is the desired effect of the for loop
in advanced_section_result.jsp
- If you directly use the sniplet info 1 instead of the
loop everything works
- If you remove the < inside the include, the code
that is generated looks like info 1 without <
BTW:
int length = a.length();
a.substring(1,length);
is equivalent with
a.substring(1);
> -----Urspr�ngliche Nachricht-----
> Von: Terje Kristensen [mailto:[EMAIL PROTECTED]]
> Gesendet: Mittwoch, 30. Mai 2001 14:25
> An: [EMAIL PROTECTED]
> Betreff: Re: AW: Why doesn't this work:
>
>
> I did what you asked me, and the files did get included, but
> it doesn't tell me much. To try an clear what I am trying to do:
>
> I want this url:
> http://localhost:8080/xsql/tek/advanced_section_result.jsp?opn
> =1&PCS=0AC10A&PCS=AAC10A
>
> To do this:
> (info 1)
> <jsp:include page="advanced_result_PCS.xsql" flush="true">
> <jsp:param name="opn" value="1"/>
> <jsp:param name="PCS" value="AC10A"/>
> <jsp:param name="PCSR" value="0"/>
> </jsp:include>
>
> <jsp:include page="advanced_result_PCS.xsql" flush="true">
> <jsp:param name="opn" value="1"/>
> <jsp:param name="PCS" value="AC10A"/>
> <jsp:param name="PCSR" value="A"/>
> </jsp:include>
>
> By doing so:
> (info 2)
> <%@ page import="java.util.*" %>
> <%
> 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 + ".xsql";
> %>
> <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>
> <%
> }
> }
> } %>
>
>
> This gets me an error. If i type in "info 1" it works
> perfectly, but when i try to do "info 2" gives me an error.
>
> What to do?
>
> Terje