Where is the user selecting the value. If it is form element then you can
send to servlet.

You can send to servlet A or B. It depends on the value of action element in
the form.

If you want to pass a value from javascript to servlet then assign that
value to a hidden form element.
Madhavi


-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of manoj
kumar
Sent: Tuesday, November 16, 1999 6:30 AM
To: [EMAIL PROTECTED]
Subject: Re: passing valuees from javascript to servlets


Hi Andras/Pradeep,

Thanks for the help.
My problem is a little bit more complicated.
I am able to pass values from a HTML element to a Servlet.
My problem is that based on that value I want to fire a query on a table.
Let me further expalin the problem.
Upon clicking a HTML link(or button), a servlet is called(A), which fires  a
select query on a table

select category_description from category_master

The result of this query is formatted into an html page and sent back
to browser.Now the user selects a particular category and presses
submit/next(whatever).This results in a call to another servlet(B) or
the same servlet(A,how..?) which in turn fires another query

select product_name from product_master where category_code=xxxxxx
This 'xxxxxxx' is something which should correspond to the category selected
by the user in the previously generated html page(by servlet A).
I was thinking of making it possible through javascript but couldn't find a
solution.

hope this clears the idea.

help is immidiately needed.

thanks


manoj



>From: Andras Balogh <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
>        Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: passing valuees from javascript to servlets
>Date: Tue, 16 Nov 1999 09:36:39 +0200
>
>     Hi,
>
>I don't see any JavaScript in Your mail :-).
>But why not read the radio button value in servlet B
>with:
>
>  reqest.getParameterValues("radiobuttonname")[0];
>or reqest.getParameter("radiobuttonname");
>
>If the problem is more complicated than that let me know.
>
>Best wishes,
>                     Andras.
>
>
>----- Original Message -----
>From: manoj kumar <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, November 16, 1999 8:48 AM
>Subject: passing valuees from javascript to servlets
>
>
> > The scenario of my problem is:
> >
> > Upon clicking a link in a HTML page, a servlet(say, A) is called, which
>in
> > turn fetches some rows from a database and returns the same to the
>browser
> > via dynamically generated HTML page. This dynamically HTML generated
>page
> > presents some options (radio buttons) to the user.
> > Upon, selecting a particular option, when the submit button is clicked,
>I
> > need that another servlet (say, B) be called (or may be the same
> > servlet(A)).This servlet B accees the databse a performs  a query on the
> > databse depending upon the option selected by the user in the previously
> > dynamically generated HTML page.
> > The query is something like this:
> >
> > select col1 from abc where col2=value
> >
> > The 'value ' in the above SQL statement is something which should
>correspond
> > to the option selected by the user.
> > How do I go about it?
> > Should I use 2 servlets or one would suffice.
> >
> > An urgent response is highly appreciated.
> >
> >
> > Thanks in advance,
> >
> >
> >
> > Manoj
> >
> >
> >
> > ______________________________________________________
> > Get Your Private, Free Email at http://www.hotmail.com
> >
> >
>___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
>body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to