Re: multiple forms and one servlet
From: marcus (marcus_at_welby.md)
Date: 10/31/04
- Next message: marcus: "Re: Setting up a filter based on server name"
- Previous message: Peter: "Re: vector bench mark?"
- In reply to: Madhur Ahuja: "Re: multiple forms and one servlet"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 30 Oct 2004 20:54:20 -0700
you can give different values to your sumbit button, or use hidden
variables in your form, which is what I do. Not a java question
Madhur Ahuja wrote:
> Yasaswi Pulavarti <yasaswi@encfor.com> wrote:
>
>>I have one servlet which has multiple forms. The action element of the
>>forms is pointing on one servlet. I want to process the different form
>>requests as different reponses in the same servlet. How can I do that
>>based on the form "Name" attribute.
>>Thanks,
>>Yasaswi
>
>
> You can do a post request and append a variable like this:
> <form method = post action = /servlet/process?pc1>
> <form method = post action = /servlet/process?pc2>
>
> Then, you write the code like this
>
> if(request.getQueryString.equals("pc1")
> {
>
> file://code for first form
> }
> else if (request.getQueryString.equals("pc2")
> {
> file://code for second form
> }
> else
> {
> //
>
> }
>
>
> --
> Madhur Ahuja [madhur<underscore>ahuja<at>yahoo<dot>com]
>
> Homepage
> http://madhur.netfirms.com
>
>
>
>
>
>
- Next message: marcus: "Re: Setting up a filter based on server name"
- Previous message: Peter: "Re: vector bench mark?"
- In reply to: Madhur Ahuja: "Re: multiple forms and one servlet"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]