PDA

View Full Version : jsp and jstl question


superman
11-13-2006, 08:56 PM
hi

i want to use a popup window to confirm to a user they have been registered

this is my code
<%@ page contentType = "text/html" %>
<%@ page import="java.sql.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix = "sql" uri="http://java.sun.com/jstl/sql" %>

<html>
<head>
</head>
<body>
<c:if test="${param.confirm_reg == 'no'}">
<jsp:forward page="register.jsp" />
<!-- if details confirmed as incorrect forward to the register page -->
</c:if>

<c:if test="${param.confirm_reg == 'yes'}">
<!-- if details confirmed as CORRECT display popup and forward to the LOGIN page -->
<script>alert("You are now registered")</script>
<jsp:forward page="login.jsp" />
</c:if>

</body>
</html>


the problem is if the details are correct it forwards them straight to the login page. I want the popup to display Registered successfully or whatever and then forward to login page. any help would be appreciated

Aradon
11-14-2006, 07:07 PM
Well it seems to me that an easy fix would be to change


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


To another jsp page that says Registration Sucessful, and then foward from that page to the login.jsp page. You may want to consider putting in a link to login or some type of meta tag refresh to login.jsp just so the user has enough time to read it.

superman
11-15-2006, 05:14 PM
thanks
i was thinking of forwarding to another page that says "you have registered please wait" but i didnt know how i could put a delay in it. I'll give that meta tag refresh a go

superman
11-15-2006, 06:27 PM
problem solved
i just redirect them after a few seconds

thanks a mill