Michael Sweeney wrote:
>
> Look into Rhino (http://www.mozilla.org/js/) and BSF
> (http://oss.software.ibm.com/developerworks/projects/bsf) through which you
> can expose the Java API to javascript and evaluate js code on the server.
>
> .michael.

Not to rain on your parade, but both these products only let you use
JavaScript as the scripting language in a JSP page instead of Java.
My understanding of what Yan wants to do is let code running in the
browser call an object living on the server, so replacing one server-side
language with another doesn't help him (probably it just adds to the
confusion).

The only way to let code in the browser invoke some object on the server
is by making a new request. One way of doing this is through an applet, as
someone else suggested, but it still requires a new HTTP request, served by
a special servlet (or JSP page), or a remote call to an RMI server, or something
similar. There's no way to assign a client-side JavaScript variable a direct
reference to a server-side Java object, or a server-side JavaScript object
for that matter (if you use Rhino or BSF). Something is always needed to
bridge the two execution environments, And that's true no matter which
language or server-side technology you use (Perl-CGI, ASP, ColdFusion, etc).

Hans

> At 12:44 PM 2/1/01 -0600, you wrote:
> >     ok, hmm, I see what you are saying, but it's a bit disappoiting. I
> > really need
> >a way to
> >dynamically pass a javascript parameter to the server object. :(
> >
> >     thanks a lot though.
> >
> >yan
>
> ===========================================================================
> 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

--
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=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to