Alireza Nahavandi wrote:
> Hi All,
>
> I need to pass a dynamic parameter to an error page :
>
> <%@ page errorPage="error.jsp?fn=b.jsp&id=xxxx" %>
>
> Is there any way to make xxxx dynamic ?

No, the page directive is not evaulated at runtime (only translation
time). To pass dynamic data to an error page, store it in the request
scope instead. With JSTL, you can use something like this:

   <c:set var="id" scope="request"
     value="${someExpressionWithTheIdValue}" />

The "id" variable is then available to EL expressions in the error page.

If you're using a JSP 1.1 container (and therefore can not use JSTL),
you can use <jsp:useBean>, a custom action or a scriptlet to store
the "id" in the request scope instead:

   <% request.setAttribute("id", aScriptingVariableWithTheId); %>

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com
JavaServer Pages        http://TheJSPBook.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to