Hey John,

What you are displaying is the correct behaviour. A redirect does NOT
function like a java return statement which stops all processing. In my
servlet code after doing a redirect I always put a return; statement. You
might try that or put the remainder of your page into a c:if with a reverse
condition to simulate an else condition.

Grtz,

Martin


-----Oorspronkelijk bericht-----
Van: John MccLain [mailto:[EMAIL PROTECTED]
Verzonden: vrijdag 19 maart 2004 23:12
Aan: taglibs user list
Onderwerp: redirect does not abort processing of current page???


I have the following code in security.jsp (I have modified it for debugging)
--------------------------------------------------------------
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
<c:if test="${true}">
<c:redirect url="login.jsp"/>
</c:if>
--------------------------------------------------------------

I put this in the top of Index.jsp as follows
------------------------------------------------------
<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
<c:import url="security.jsp"/> <---- here is the import stattement
<html>
<head>
<title>Insight Client</title>
<script LANGUAGE="JAVASCRIPT" SRC="JavaScript/Style.js"></script>
<script LANGUAGE="JAVASCRIPT" SRC="JavaScript/Frames.js"></script>
</head>
  <frameset cols="*,800,*" frame
.
.
.
-------------------------------------------------------------

I have stepped through both jsp's as they run and it seems that
the index_jsp servlet code calls _jspx_meth_c_import_0(....)
which goest into the security_jsp.java code. In there it goes through the
if,
calls the redirect,
and skips rendering anything else in security.jsp; But
when we get back to the import function in index_jsp.java, we don't skip any
more pages,
so what happens is Index.jsp continues to render.
What I want to do is include/import secury.jsp so that if a person has not
logged in
(I replaced this with test="${true}" for debugging), we redirect to
login.jsp and do NOT
render index.jsp. Login.jsp calls a servlet which ultimately redirects to
Index.jsp

Any help would be appreciated


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to