Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
| Search | Today's Posts | Mark Forums Read
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 24th, 2006, 11:42 PM
Authorized User
 
Join Date: Dec 2005
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Is it possible to set $_Session Variables in java

I would like to know if it is possible to save a value from a php form in a session using a java function.


What I am doing:

I have a php form. The form contains a textbox and 2 list menus (drop down box) The second drop down box relies on the selection made in the first.

within the reload() java function I save the value entered in the first list menu (using the onChange="reload(this.form)" ) I pass the variables in the url. The users selection loads values into the second list menu. Where the user can make a second selection. This value is passed using the same method.

What I would like to do is save the textbox (or all the entered values) values in a session using a java function. When the user changes the a value or enters one.

Thanks
  #2 (permalink)  
Old February 13th, 2006, 05:41 AM
Friend of Wrox
 
Join Date: Jan 2006
Location: San Francisco, CA, USA.
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Look at the javax.servlet.http.HttpSession object. You can get one by calling HttpServletRequest.getSession(). Then call HttpSession.setAttribute(String, Object) to set a session variable, and HttpSession.getAttribute(String) to retrieve one.

Jon Emerson
http://www.jonemerson.net/


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set a session in Java Filter? Edward King Pro JSP 1 January 31st, 2006 05:34 AM
Can session variables be used inside Java? Annoyamouse BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 October 14th, 2004 02:26 PM
Set multiple variables with one Select? djuricd SQL Server 2000 2 June 14th, 2004 08:08 AM
How to set up Java AppServer partho_choudhury J2EE 7 June 14th, 2004 02:29 AM
Storing binary data in $_SESSION variables richard.york Pro PHP 0 August 30th, 2003 05:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.