Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: Passing Session variable from one JSP to Another JSP page


Message #1 by =?iso-8859-1?q?ashok=20sahay?= <ashok_sahay@y...> on Wed, 2 Oct 2002 13:56:23 +0100 (BST)


>From: ashok sahay <ashok_sahay@y...>
>Reply-To: "Pro_JavaServer_Pages" <pro_jsp@p...>
>To: "Pro_JavaServer_Pages" <pro_jsp@p...>
>Subject: [pro_jsp] Passing Session variable from one JSP to Another JSP 
>page
>Date: Wed, 2 Oct 2002 13:56:23 +0100 (BST)
>
>
>Hi All,
>
>I have one jsp page say jsp1.jsp which contains one input type =text and I 
>want theis dynamic value to an another jsp page jsp2.jsp as a session 
>variable for some specific reason.I am Using weblogic 5.1 as application 
>server.
>
>Can any one come out with best solution that can be for this scenario.
>
>
>
>Best Regds and thanx in advance
>
>ashok
>
>Mobite A/S ,Denmark
>
>
>
>
>Best Regds.,
>Ashok
>  Yahoo! Properties Special  Buy, sell, rent...your flat, or even post an 
>ad
>


You can use another hidden variable and when u submit the form call a 
javascript function which will assign the value of first textbox to the 
second box.

Then before <HTML> tag write code which sets the session attribute value.




I can give a outline



<%
String str=request.getParameter("hid1);
'and code for setting session attribute goes here
%>
<html>
<head>
<script language="javascript">
function formSubmit()
{
document.frm1.elements("hid1").value=document.frm1.elements("txt1").value;
document.frm1.submit();
}
</script>
</head>
<body>
<form name="frm1" method="post">

<input type="text" name="txt1">
<input type="hidden" name="hid1">
<input type="submit" name="" onclick="formSubmit()">
</form>
</body>
</html>




hope this helps

Srividhya

_________________________________________________________________
Join the world?s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


  Return to Index