This should do what you're looking for: In the HTML use the javascript onClick
event to trigger the following action ..

Bind the values to the request .....

request.setAttribute("catName",<%= Categories[i][0] %> );
request.setAttribute("catId",<%= Categories[i][1] %> );

Then use RequestDispatcher to forward the request ....

      RequestDispatcher rd =
getServletContext().getRequestDispatcher("CategoryMaint.jsp");

      if ( rd != null ) {
         rd.forward(req,res);
      }

In CategoryMaint.jsp you can then access these values with ...

request.getAttribute("catName");

Hope this helps,

Stephen.

PS. I suppose you could also use cookies, but that's a longer story :-)


Rahul Naithani wrote:
>
> Hi friends,
> The problem in life is that if I have an href like this:
>
> <A href=  "CategoryMaint.jsp" %> <%= Categories[i][0] %> </A>
>
> Then in CategoryMaint.jsp, how can I get to know the id of Category clicked
> on? Assuming the Category Name is stored in Categories[i][0] and category id
> is stored in Categories[i][1].
>
> I Don't want to :
> 1) Use Client side scripting.
> 2) Use QueryString because it displays the users the value of category id.
>
> Please help.
> Regards,
> Rahul.
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

--
._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
 Stephen Redmond                        Logica (Mobile Networks)
 Tel:   +353-1-8193673                  5 Custom House Plaza,
 Fax:   +353-1-8193401                  Harbourmaster Place,
 mailto:[EMAIL PROTECTED]             Dublin 1,
 http://www.logica.com/telecoms         Ireland.
._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to