• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling javascript from a java code

 
madhuri madhuri
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

Please correct me if this is not the right place to post this question.

Here is my requirement, I have a simple Java code where in I have an object and there are a number of filters that the object has to go through. The filters that I am talking about have to be editable in the sense that they have to be configurable. One of the team members here have suggested that we go for writing a javascript that does the filtering process on the object that we send in and returns a modified object.

Can anybody suggest me the ways to call a java script method from the java code to meet my requirement...?

Pl let me know if i m not clear...!!

Thanks,
Madhuri
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15216
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the documentation for the package javax.script (new in Java 6.0).

If your version of Java is older, have a look at Rhino.
[ April 17, 2007: Message edited by: Jesper Young ]
 
Roger F. Gay
Ranch Hand
Posts: 408
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah! Yeah! That was part of what I found ... couldn't remember. I was trying to suggest something about a netscape LiveConn type support in later versions of JavaScript (in the html / javascript forum during the Ajax in Practice week); but the Java calling script part was in javax.

I just want to say that this is a great topic for discussion. I'd be very active here immediately if I had more time to commit (but will do what I can whenever I can).

Excellent question. Good issue. Put this together with AJAX, and ....

Just a general comment to add ... was just identifying with another (2) questions in the distributed Java forum on RMI. Don't we all want simple two-way interactions with just about everything in every way? Whether it's javascript - java; server - client; ..... Is it just me (and apparently a few others) that could think this should be a primary issue in the development of software technology ... i.e. not just left up to millions of application developers to repeat?

I'm just asking for opinion ... I don't know if we can start a W3C standards committee from here or not.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic