Hi

Is it possible to pass parameter to a JSP inside a template? Or is there an
alternate way to do this.

I have a JSP page SQLDisplayRowResult.jsp, I created a link with will call
its template  SQLResult.jsp passing a parameter called "offset".
SQLResult.jsp will detect if a parameter is passed and "forward" the
parameter to SQLDisplayRowResult.jsp.

When I run the code, the SQLResult.jsp is created but
SQLDisplayRowResult.jsp is not. Can anyone give me some advice as to how I
can sort this out?

My example are provided below.

TIA

Michael Mok

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
SQLDisplayRowResult.jsp

 <logic:present parameter="offset">
<!-- do something -->
</logic:present parameter>
 <logic:notPresent parameter="offset">
   <%
    String nextURL = "/SQLResult.jsp?offset=5";
   %>
   <html:link page="<%=nextURL%>">Next Page</html:link>
 </logic:notPresent>

SQLResult.jsp

<template:insert template='/template/master_template.jsp'>
 <logic:present parameter="offset">
 <bean:parameter id="offset" name="offset"/>
 <%
  String displayrowresult = "/SQLDisplayRowResult.jsp?offset="+ offset;
 %>
   <template:put name='display' content='<%displayrowresult%>' />
 </logic:present>
 <logic:notPresent parameter="offset">
   <template:put name='display' content='/SQLDisplayRowResult.jsp' />
 </logic:notPresent>
  </logic:present>
  <template:put name='footer' content='/template/footer.html' />
</template:insert>

Reply via email to