passing arguments from a java file to a webpage

Discussion in 'Perl Misc' started by leorulez@gmail.com, Feb 28, 2006.

  1. Guest

    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.
     
    , Feb 28, 2006
    #1
    1. Advertising

  2. Matt Garrish Guest

    <> wrote in message
    news:...
    >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
     
    Matt Garrish, Feb 28, 2006
    #2
    1. Advertising

  3. J. Gleixner Guest

    wrote:
    > 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/.
     
    J. Gleixner, Feb 28, 2006
    #3
  4. Guest

    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.

    J. Gleixner wrote:
    > wrote:
    > > 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/.
     
    , Mar 1, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    599
    Thomas Weidenfeller
    Mar 2, 2006
  2. Replies:
    1
    Views:
    433
  3. Paul
    Replies:
    14
    Views:
    857
    Alexey Smirnov
    Jun 19, 2008
  4. sifar
    Replies:
    5
    Views:
    431
  5. oldyork90
    Replies:
    10
    Views:
    348
    Jorge
    Sep 27, 2008
Loading...

Share This Page