You can access java bean from javascript function like this:
--example-------------------------------------------------------------------
---
<jsp:useBean id="Password" scope="request"
class="com.myproject.PasswordBean" />
<SCRIPT LANGUAGE="JavaScript">
function validatePassword()
{
var returnValue = true;
if (document.password.newpassword.value == <%=Password.getPassword()%>)
alert("You must enter a different one!");
returnValue = false;
}
return returnValue;
}
</SCRIPT>
----------------------------------------------------------------------------
----
D. Jiang
Sun Certified Java Programmer
[EMAIL PROTECTED]
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of giri punn
Sent: Thursday, January 11, 2001 12:52 PM
To: [EMAIL PROTECTED]
Subject: Can JavaScript access JavaBeans?
Hi,
I want to access javabean from a javascript function? please let me know if
this is possible?
thanks,
giri
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.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=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
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