conditional redirect from index.jsp

I have an index page for the application that I want to use to send the user to either the login page or the search page depending if they are logged in already. I have the following :

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC"-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/loose.dtd">

<%@include file="/WEB-INF/jspf/taglibs.jspf" %>

<c:if test="${sessionInfo.loginProfile eq null}">

<jsp:forward page="/login.jsf" />

</c:if>

<c:if test="${sessionInfo.loginProfile ne null}">

<jsp:forward page="/search.jsf" />

</c:if>

but it uses forwards and the browser URL does not redraw. How do I do a redirect without using scriptlets in the JSP page?

Is there a way to call a method binding expression automatically upon a page being loaded? If so I could create a backing bean for the index page and then use different outcomes in the navigation rule to achieve what I want.

Thanks

Chris

[1374 byte] By [ccheshirea] at [2007-11-27 8:35:38]
# 1
Try the JSTL c:redirect tag...
rlubkea at 2007-7-12 20:32:18 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Perfect, thanks for the speedy solution! :)
ccheshirea at 2007-7-12 20:32:18 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...