Sankar,
onClick is a JavaScript event(as you now know not
a Java event).
Probably not the best to event use anyways.
onMouseDown works just as good.
You can load the values of a hidden filed and
submit a form that would pass values to the next
JSP page...
<form name="myform" action="someurl.jsp" >
<input type="hidden" name="myval" value="<%=
some_java_value %>" >
<input type="hidden" name="otherval" value="<%=
some_other_java_value %>" >
<span onMouseDown="document.myform.submit()"><a
href="" >Link</a></span>
</form>
Or even build your href in JSP using java like
this...
<a href="someurl.jsp?myval=<%= some_java_value
%>&otherval=<%= some_other_java_value %>" >
Assuming you have created those values some where
before.
Cheers,
Franciscus Dylan del Rosario
IBM Data Management Solutions Group - a.k.a. DB2
Codernauts say good by to the closed world.
Find more code like this at:
ibm.com/developerWorks
-----Original Message-----
From: A mailing list about Java Server Pages
specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of
Hans Bergsten
Sent: Tuesday, July 10, 2001 12:08 PM
To: [EMAIL PROTECTED]
Subject: Re: jsp:forward onClick
M Sankar wrote:
>
> Hi,
>
> Can I use jsp:forward page onClick of a
menuitem. If yes how it is
> possible?
No. onClick is a JavaScript thing, executed by the
browser. <jsp:forward>
is a JSP action element, executed by the server to
continue processing of
the a request for one JSP page using another JSP
page or servlet.
The only thing you can do with onClick is to make
a new request to the
server, e.g. to process a JSP page or a servlet.
You may want to read a book about JSP to learn
more about the JSP
action elements, and what you can and can not do
by mixing server and
client side code. I can recommend mine :-)
<http://TheJSPBook.com/>
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software
http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly),
http://TheJSPBook.com
==================================================
=========================
To unsubscribe: mailto [EMAIL PROTECTED] with
body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with
body: "set JSP-INTEREST DIGEST".
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=JS
P
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Se
rvlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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