Hi, Rohit
A servlet is not created every time you click on a link referencing one. There
is only one instance of the servlet class associated with every registered
servlet name (unless your servlet implements the SingleThreadModel interface, in
which case the servlet container may pre-create a pool of instances). A servlet
has access to its initialization parameters by calling
GenericServlet.getInitParameter(String name) for each named parameter. The
initialization parameters thus obtained are set on server startup in your web
application's web.xml deployment descriptor, which means they don't vary at
runtime.
I'm just guessing at what you're trying to do, but it seems you want to perform
a query on the second HTML page based on a selection criterion from a parameter
passed in the first. In this case, if the parameter does not vary, you can
embed something like this in your first page:
<a href="/myapp/myservlet?param=myparam">
If your parameter varies, then you probably have to set up a form to receive the
parameter before sending it.
I realize that the above explanation might seem rather concise for someone new
to servlets. I can help you best by directing you to Sun's Tutorial on Servlets
Hope this helps.
Regards,
Noel Lecaros
Rohit Dhiman wrote:
> Dear all,
>
> I am new to servlets and i am facing a problem in the servlets.I have a
> HTML page which has a link to a 2nd HTML page in it.The second HTML page has
> frames in it.In on of the frame a servlet displays some data in the form of
> a table.
>
> Now i want to when this 2nd page is opened, the servlet should
> automatically
> fetch a inital parameter at startup.
>
> please note that in the 1st HTML page there are say 10 links and i want
> each
> time , each of these links when clicked should display a 2nd HTML page with
> a unique initial parameter........
>
> any suggestions are most welcome,
>
> kind regards,
>
> Rohit
>
> ___________________________________________________________________________
> 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