Jsp Tutorial Home

Jsp Home

JSP Resources

Community

Site

Mutipage Forms-3


This page is responsible for the validation. If validation fails it will again transfer the control to the first page with the errors.


multipage3.jsp









<%@ page language="java" contentType="text/html; charset=ISO-8859-1"

pageEncoding="ISO-8859-1"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">


</head>

<body>

<jsp:useBean id="bean" class="com.visualbuilder.beans.RegistrationBean" scope="session"/>

<jsp:setProperty name="bean" property="phone"/>

<jsp:setProperty name="bean" property="address"/>

<jsp:setProperty name="bean" property="city"/>

<jsp:setProperty name="bean" property="country"/>

<jsp:setProperty name="bean" property="state"/>


<%

com.visualbuilder.beans.RegistrationBean register=(com.visualbuilder.beans.RegistrationBean)session.getAttribute("bean");

    register.validate(request);

    String errors= (String)request.getAttribute("errors");

    if( errors != null && errors.trim().length() >0){

%>


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

<%

}

%>


<h1>The given data is Valid.</h1>

</body>

</html>



Output:- The following page wil be displayed if any errors occured in the form.




 

                    

Copyright © 2010 VisualBuilder. All rights reserved