Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to show up an alert on loading a JSP page which redirects to another pg

843835Apr 2 2003 — edited Apr 2 2003
I want to show up an alert saying 'Item added to cart' when i click on the 'Add to Shopping cart' link.

Clicking on the link calls cart.jsp.

An excerpt from cart.jsp

<html>
<%@ page language="java" %>
<jsp:useBean id="cart" session="page" class="stoppe.beans.cartbean" />

<%
session=request.getSession(false);
cart.addProduct(request);
%>
<body onLoad="alert('Item added to the cart')">
<%
response.sendRedirect("store.jsp");
%>

</body>
</html>

But the alert never shows up.If i comment the response.sendRedirect() its showing up ofcourse showing a blank screen.How this could be done?.Anyone got a clue??.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2003
Added on Apr 2 2003
1 comment
641 views