473,396 Members | 1,913 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Call Java from JavaScript, and get back results (Lucene)

Hi, all.

I know that there is a way of using JavaScript to call a Java method,
and for the JavaScript to collect some sort of response from the Java,
as I had a page working a few years ago that used Java to read a file
from the filesystem then the JavaScript formatted the contents of the
file (a simple list) by wrapping HTML tags round certain fields.

Now, I am trying to make an HTML page that presents a query form, that
would then pass the query to Lucene and present the results in an HTML
page.

The final application is a searchable CD containing HTML and PDF
documents.

So far, I have a working version of Lucene, I can build an index and
search from the command line.

I cannot use a webserver, so all the examples and tutorials that I
have found so far, relying on Tomcat, are unhelpful.

Can anybody help me out, or point me to a tutorial on the mechanism
for using Java and JavaScript together?

Thanks in advance.. (and apologies for using Google to post to Usenet).

Apr 11 '07 #1
1 3043
ke**********@yahoo.com wrote:
I cannot use a webserver, so all the examples and tutorials that I
have found so far, relying on Tomcat, are unhelpful.

Can anybody help me out, or point me to a tutorial on the mechanism
for using Java and JavaScript together?
As far as I know there is nothing special about HTML served up by a webserver
for this purpose. If the HTML that the browser is rendering is in the local
filesystem, and if the applet (jar file, or .class files) is also on the local
filesystem, then the APPLET tag will work just the same, and Java/JavaScript
will talk to each other in just the same way, as would be the case if both were
pulled off a webserver by HTTP.

Note "work just the same" does not necessarily imply "work well". I think you
may have problems using Lucene from an HTML page, unless you can ensure that
the user stays on the same page throughout. (I'm not sure, but I /suspect/
that changing pages might cause problems by closing down the applet -- thus
potentially loosing Lucene's state.)

-- chris
Apr 13 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Phil Powell | last post by:
URL: http://valsignalandet.com/cookiegrab.php?name=valIdentifier This page produces a cookie value and sends it back as HTML using PHP and Javascript to obtain it. This URL will be used as the...
9
by: Martin Waller | last post by:
Hello, I've been playing with the idea of just how to use an ASP page to provide a remote function call. In an ideal world this would be a web service but how can you do it if restricted to ASP...
3
by: Robert Brown | last post by:
Hi All.. What I have is a normal ASP web page wih javascript. The javascript needs to call a payment gateway, but the only way to get to it is https://paymentgateway/external.pl with parameters....
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
2
by: mhust6 | last post by:
I am trying to call a java method from within my Javascript, but cannot seem to get it to work. All the examples I have found online and in the forums are using Java applets. I have a method that...
0
by: dashprasannajit | last post by:
package djvusearching; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import org.apache.lucene.analysis.cjk.CJKAnalyzer; //import...
9
by: misdst23 | last post by:
Hi, I know I can call a static java method within javascript by using the <% ... %tags. But how can pass a javascript variable ? function thefunction() { var = javascriptvariable ;
4
by: Ty | last post by:
Hello all, I am creating a web site with Visual Stuido 2008. I am trying to use a java script file to create a busybox for login from this page http://blogs.crsw.com/mark/articles/642.aspx. I...
0
by: davidvikimca | last post by:
Dear sir, I am trying some simple programs for search using lucene. I am trying to use SnowballAnalyzer in my search for "English" Language. I am using lucene-2.4.0 . On execution...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.