passing arguments from a java file to a webpage

L

leorulez

I have a java program which can pass values (d_name,item) to any file
that I desire. If I choose html and after linking this html file with
the
java program, when I open the html file the address bar is something
like this:

"http://abcd.org/test.html?op=add&d_name=NAME&item=data@19b9e1e"

I want to use these passed values in my webpage. I was wondering if
this can be done better using perl. Is there any way I can refer these
passed arguments using perl?
Thanks for any help.
 
M

Matt Garrish

I have a java program which can pass values (d_name,item) to any file
that I desire. If I choose html and after linking this html file with
the
java program, when I open the html file the address bar is something
like this:

"http://abcd.org/test.html?op=add&d_name=NAME&item=data@19b9e1e"

I want to use these passed values in my webpage. I was wondering if
this can be done better using perl. Is there any way I can refer these
passed arguments using perl?

Not on the client side. You probably want to take a look at using javascript
to read the query string.

I don't really understand what this java program is, though. Is it a servlet
that redirects to the html? If so, then you could certainly write a another
cgi script in perl to receive the arguments and send back an html page to
the user. If that's all you're after, take a look at CGI.pm (in particular
the param function).

Matt
 
J

J. Gleixner

I have a java program which can pass values (d_name,item) to any file
that I desire. If I choose html and after linking this html file with
the
java program, when I open the html file the address bar is something
like this:

"http://abcd.org/test.html?op=add&d_name=NAME&item=data@19b9e1e"

I want to use these passed values in my webpage.

How? What's generating your HTML?
I was wondering if
this can be done better using perl. Is there any way I can refer these
passed arguments using perl?

I don't fully understand what it is you are asking. The language doesn't
make it better or worse, Java has methods to deal with those things, as
do many languages, so why are you wanting to code something else in perl?

Are you using a CGI written in perl and you want to pass those
attributes to it or do you want to pass that string from your Java
program to a perl script to process or something else?

If you're wanting to learn about CGI processing, using perl, there are a
lot of Web sites that cover it. However, if you have everything coded in
Java and that's what you understand, then it's probably best to stick
with it. No sense in making it more complicated than it needs to be.

Helpful perl modules to look at would be CGI and LWP, available from
http://search.cpan.org/.
 
L

leorulez

Sorry for not being very clear.
I have a Java program (an applet) which works perfectly well. This
applet has a button which when clicked should take the user to a
webpage. Its like of a shopping cart. When the order button is clicked
the order webpage should open up which will have the details of the
order. So I need to pass the order details from the applet to the
webpage. I have included the code to pass the values in the applet. But
I am stuck with the order page. Now I need to display the order
information on the webpage as a link.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top