Hi,
i want to call another jsp from a jsp.lets say one.jsp and two.jsp. So one.jsp has a form. two .jsp need to get that values from one.jsp.
Can 'request.getparameter()' be used in two.jsp to get the parameters sent by the one.jsp.please can any one help me?
this is my two.jsp
<%@ page language="java" contentType="text/html"%>
<jsp:useBean id="crt" scope="session" class="beans.MyShoppingCartNew"/>
<html>
<head>
<title>Cart Items</title>
<SCRIPT type=text/javascript>
function checkForm( )
{
ccv = document.getElementById('ccv').value;
if ( ccv.length == 3 && !isNaN( ccv ) )
{
return true;
}
else
{
alert( 'Please enter in your CCV number.' );
return false;
}
}
</SCRIPT>
</head>
<body bgcolor="#EF8428" onload="load1()">
<HR width="1200" color="red" noshade>
<table align="right" border="0" cellpadding="10" >
<tr>
<th size="200px" bgcolor="khaki"><a href="Login.html"> Sign In </a></th>
<th size="200px" bgcolor="khaki"><a href="MenuList.html"> Register </a></th>
</tr>
</table>
<table border="0" cellpadding="10">
<tr>
<th size="200px" bgcolor="khaki"><a href="welcome.html"> Home </a></th>
<th size="200px" bgcolor="khaki"><a href="MenuList.html"> Menu </a></th>
</tr>
</table>
<HR width="1200" color="red" noshade>
<% String fname=request.getParameter("FName");
String sname=request.getParameter("SName");
String phone=request.getParameter("Phone");
String email=request.getParameter("Email");
String address1=request.getParameter("Address1");
String street=request.getParameter("Sreet");
String address3=request.getParameter("Address3");
String area=request.getParameter("Area");
String ddate=request.getParameter("Ddate");
String dtime=request.getParameter("Dtime");
crt.CusDetails.derCusData(String fname,String sname,String phone,String email,String address1,String street,String address3,String area,String ddate,String dtime);
int crt=crt.getcost();
%>
<FORM onsubmit="return checkForm()" method="post" name="ccForm" action="">
<input type="hidden" name="totCst" value="<%=cst%>">
<H1 align="center">Credit Card Details</H1>
<P align="center">You will be charged <STRONG><%=cst%></STRONG></P>
<P align="center"><FONT color=red></FONT></P>
<TABLE CELLSPACING="10PX" align="center">
<TR><TD>Card Number:</TD>
<TD><INPUT type="text" name="ccnumber"/></TD>
</TR>
<TR>
<br><TD>Card Type:</TD>
<TD><SELECT name="card_type">
<OPTION value="visa">Visa</OPTION>
<OPTION selected value="Master Card">Master Card</OPTION></SELECT> </TD></TR>
<TR>
<br><TD>Expiry Date:</TD>
<TD><SELECT name="month">
<OPTION selected value=01>1</OPTION>
<OPTION value=02>2</OPTION>
<OPTION value=03>3</OPTION>
<OPTION value=04>4</OPTION>
<OPTION value=05>5</OPTION>
<OPTION value=06>6</OPTION>
<OPTION value=07>7</OPTION>
<OPTION value=08>8</OPTION>
<OPTION value=09>9</OPTION>
<OPTION value=10>10</OPTION>
<OPTION value=11>11</OPTION>
<OPTION value=12>12</OPTION></SELECT>
<SELECT name="year"> <OPTION selected
value=07>2007</OPTION> <OPTION value=08>2008</OPTION> <OPTION
value=09>2009</OPTION> <OPTION value=10>2010</OPTION> <OPTION
value=11>2011</OPTION> <OPTION value=12>2012</OPTION> <OPTION
value=13>2013</OPTION> <OPTION value=14>2014</OPTION> <OPTION
value=15>2015</OPTION> <OPTION value=16>2016</OPTION> <OPTION
value=17>2017</OPTION> <OPTION value=18>2018</OPTION> <OPTION
value=19>2019</OPTION> <OPTION value=20>2020</OPTION> <OPTION
value=20>2021</OPTION></SELECT> </TD></TR>
<TR>
<br><TD vAlign="top">Name:</TD>
<TD vAlign="top"><INPUT size=30 type="text" name="fullname"><BR><SMALL>(as
printed on card)</SMALL></TD></TR>
<TR>
<br><TD vAlign="top">CCV:</TD>
<TD vAlign="top"><INPUT id="ccv" size=3 type="text" name="ccv"><BR><SMALL>The CCV
number is the 3 digit number found on the back of your credit
card</SMALL></TD></TR>
<TR>
<td></td><TD><BR><input type="submit" value="I authorised this transaction"></TD></TR></TABLE>
</FORM>
</body>
</html>