Solved

Passing parameters between pages

Posted on 1998-09-24
6
180 Views
Last Modified: 2013-12-25
Can anybody give me an Example?

Y 'am working with Java and Y have 2 pages in the same Window of the Browser.
In Page A  Y am calling Page B with the statement showDocument like this :

showDocument(PageB)
This works fine but if Y have to pass a Parameter should Y do like this ?
showDocument(PageB?name=value)

If it`s like this how should be the code of PAGE B ( the code to receive the parameter).

Y'am not shure  if Y'am doing this rigth.
PD: Y heard something about CGI but Y don't know much ( so Y need an Example)


 
0
Comment
Question by:Pampa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 1

Author Comment

by:Pampa
ID: 1828814
This is a very important question for me.
Please answer me as soon as posible.
Thanks
0
 
LVL 28

Expert Comment

by:sybe
ID: 1828815
Yes, you can pass a parameter to a page like you suggest:

http://www.somewhere.com/pageB?name=value

and if you want to pass more parameters

http://www.somewhere.com/pageB?name1=value2&name2=value2 (etc)

CGI-scripts can read the parameters passed and respond to those parameters. CGI is a general term for this functionality. CGI scripts are written in a language. Perl is a very common language.

The code for PageB depends on the language.

0
 
LVL 5

Accepted Solution

by:
b2pi earned 200 total points
ID: 1828816
showDocument(PageB?name=value) will load PageB?name=value... that much
should be clear.  If you make PageB  a cgi script, say, PageB.pl,
and call it with an exec, then the environment variable QUERYSCRIPT
will have the text of everything past the URL.  To parse it, you can
use:

#!/usr/local/bin/perl -w
use strict;

print "Content-type: text/html\n";
my($e) = $ENV{QUERYSCRIPT};

print "Arguments:\n";
$e = '' unless defined($e);
$e =~ s/^\s+|\s+$//g;
if ($e eq '') {
    print "\tNone\n";
} else {
   my($pair, $name, $value);
   foreach $pair (split(/\?/, $e)) {
       ($name, $value) = split(/=/,$pair);
       print "\t$name:\t'$value'\n";
   }
}



0
Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

 
LVL 1

Author Comment

by:Pampa
ID: 1828817
First y wolud like to thank you for your answer, but Y need you help me a bit more....

1)My Error.......
When  Y told you that the code of page A is showDocument(PageB?name=value) y should have write    that the code of Page A is showDocument(PageB?value1,value2,....valuen).

2) Y wrote the code you send me in page B, but Y didn´t have any results.
PD: Y don't know HTML,or JAVA SCRIPT only JAVA (so please be as much specific as you can)

3) In Page B y HAVE TO write the following HTML code :
     
     <APPLET CODE = "MyApplet.class" WIDTH=200,HEIGTH=200>
     <PARAM NAME =  MyInternalVariable1   VALUE = "Pepe1">
     <PARAM NAME =  MyInternalVariable2   VALUE = "Pepe2">
     </APPLET>
   
   In this case "Pepe1" and "Pepe2" are  the parameters which Y recive from page A.
   for example showDocument(PageB?"Pepe1","Pepe2")

Can Y put this HTML code inside the code that you give me?
Where should Y put this code?
Is it possible?
Y need you write again a Full example, but with all this questions answered please.
You will make me a great favour.
Thanks
Fernando
0
 
LVL 1

Author Comment

by:Pampa
ID: 1828818
Please see the coment above, and what Y need is a FULL example
Can you Help me ?

0
 
LVL 5

Expert Comment

by:b2pi
ID: 1828819
You gave me a D, and you want additional help?  Nope, doesn't parse.
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
change the windows script file to BAT 10 59
CSV file copy field 1 to field 2 2 62
New-MoveRequest Exchange 2010 Powershell 1 56
Ruby or Python 7 130
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question