OK, time is almost up now if not already.  But here is a quick and dirty way
which is probably the simplist.  I am showing this mainly for users who are
curious and to hopefully encourage them to learn on their own or invite the
help of this list more than 4 hours before.  :)

Anyway, as I said this is probably the simplist quick and dirty way.  This
isn't recommended for people with whole JSP/Session/Cookie/XML/... types of
setups.

As before have your hidden field but you must output this dynamicaly from the
servlet.  Assuming your user id is in a string userID do this

out.println("<INPUT type=hidden value=" + userID + " name=user_id>");

You can use buffered strings as you like to make it a little cleaner.  Notice
the out.println() method.  This must be done from inside the servlet, JSP,
etc.  You cannot output a static HTML page with dynamic content.  I'm not sure
but your message was a little unclear with all the changes and it almost
sounded like you were trying this.

Your servlet which handles the request would simply then use
string userID = request.getParameter("user_id");
in order to get the variable.

Well, that's all.  Again this is the quick and dirty method perfect for
cramming together a school presentation in a few hours where no one will see
the back end logic.  For actual real world systems of course the better methods
are sessions, jsp, cookies, database interactions, whatever suits you according
to your need.

Matt Penner

Quoting Farooqui Hamid <[EMAIL PROTECTED]>:

> Thanks everybody for your help
> I m now stuck at this point
> <INPUT type=hidden value=userID name=user_id>
>
> In the above line userID is the variable which i m getting from my
> earlier
> servlet
> How do i set the value=variable
> Right now my next servlet gets the value as "userID" hardcoded
>
> TIA
>
> HAMID
>
> ___________________________________________________________________________
> 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