You are setting an attribute and retrieving a parameter, they're not the same thing.
Try request.getAttribute("name"). As for returning to the included page, yes, that is
per spec behaviour.

Have a nice day! :)

/Magnus Stenman, the Orion team

----- Original Message -----
From: Neal Kaiser <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, October 26, 1999 2:30 AM
Subject: why is forward() returning to calling servlet?


> I have a jsp with a bean tag at top (before any output). If the bean tag
> throws an
> exception, it calls a RequestDispatcher.forward() to an Error Handling .jsp.
> For some reason, the JSP returns control back to the calling jsp(servlet)
> after
> it runs. Is this expected behariour?
> ie:
> <jsp:useBean id="db" scope="page" class="DbBean" />
> <%
>   db.callmethod(); [exception gets throw in this method]
> %>
> <HTML>
> Shouldn't reach here, but does?
>
> Also, before I call the forward() in the Bean, I set a few request
> parameters. I get null values for these in my ErrorHandler jsp?
>
> example:
>    (from the Bean)
>        RequestDispatcher dispatcher =
> application.getRequestDispatcher("/ErrorHandler.jsp");
>         req.setAttribute("error-code","103");
>         dispatcher.forward(req, res);
>
> (now in ErrorHandler.jsp)
>
> %
>   String error_code = (String)request.getParameter("error-code");
> out.println(error_code); [This gives me "null"]
>   %>
>
> Any ideas what I'm doing wrong?  I'm using OrionServer....
>
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to