To elaborate...
The javascript:
function AddRecord() {
document.tableForm.action="/servlet/AddRecord"
document.tableForm.submit();
}
function DelRecord() {
document.tableForm.action="/servlet/DelRecord"
document.tableForm.submit();
}
The buttons:
<INPUT TYPE="Submit" VALUE="Add" onClick="AddRecord()">
<INPUT TYPE="Submit" VALUE="Delete" onClick="DelRecord()">
Hope this helps.
Justin
> -----Original Message-----
> From: Welllington Lacerda [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, June 19, 1999 7:07 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Calling difeerent servlets from one HTML
> Importance: High
>
>
> Nitin,
>
> As you can see there are basically 2 choices:
>
> (a) Having a javascript on the page that will change the
> action parameter
> (b) Having a selector servlet that will redirect your request
> accordingly.
>
> I do prefer and use the (a) option for a simple reason :
>
> - It provides load balancing between your server and it's
> client. It seems not important to your server's process to
> know how to perform that choice, as long as it has been done
> correctly. Every time I face options like this I choose to
> ease the job for my server.
>
> - You can act for your client more promptely, asking for sure
> or correctness in the browser, so saving a time that can be
> used solely to show a message like "FORBIDDEN". It's not
> machine time it's your client time. Act on the client instead
> of on the server in cases like that seems to be
> much more eficient to me.
>
> Hope this helps to clear things
>
> Wellington Lacerda
> BRAZIL
>
> Resource Allocation wrote:
>
> > Hi All,
> >
> > I'm facing a problem in calling diferent servlets from a
> single HTML. As you know we specify the servlet's address and
> name in action parameter of form tag. But what do I do if I
> want to call different servlets depending on what button is
> pressed. Does anybody knows some thing about it.
> > Please respond urgently.
> >
> > Thanx in advance,
> >
> > Nitin
> >
> > IMRglobal Ltd.
> > Plot # 22, SEEPZ,
> > Andheri (E), Mumbai-400096
> > Phone : 8291421 Ext. 151
> > Mail To : [EMAIL PROTECTED]
> >
> >
> ______________________________________________________________
> _____________
> > 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
>
___________________________________________________________________________
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