How do I pass a variable from one form to the next in JSP


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: How do I pass a variable from one form to the next in JSP

  1. #1
    Join Date
    Sep 2005
    Posts
    39

    How do I pass a variable from one form to the next in JSP

    How do I pass one variable from one form to the next in JSP when it is NOT being passed in a form tag? There is no submit button

    I know how to use the request.getParameter(variableName) and then do an
    <input type = “hidden” name = “variableName”>

    But this only works in a form tag. How else can I pass a variable?

  2. #2
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    1,560
    I can think of one solution using javascript, where you build the url for the JSP
    with name/value pairs like:

    <url to jsp>?name1=value1&name2=value2 (etc.)
    eschew obfuscation

  3. #3
    Join Date
    Oct 2005
    Posts
    40

    Lightbulb

    If you do not want messy code. You can simply use session variables to pass some information from one page to other.

    Regards,
    Mohit

  4. #4
    Join Date
    Sep 2005
    Posts
    39
    Thanks both of you. I got it to work with the name value pair in jsp.

Similar Threads

  1. Replies: 7
    Last Post: 10-28-2002, 12:10 PM
  2. Replies: 0
    Last Post: 04-11-2002, 06:48 PM
  3. Detecting change of MDI child form
    By Tim Coulter in forum VB Classic
    Replies: 20
    Last Post: 02-01-2001, 06:49 AM
  4. Replies: 1
    Last Post: 11-16-2000, 09:16 PM
  5. Replies: 3
    Last Post: 04-12-2000, 04:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center