From owner-freebsd-questions@FreeBSD.ORG Sat Aug 16 09:15:42 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D7DE37B401 for ; Sat, 16 Aug 2003 09:15:42 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 43D9944025 for ; Sat, 16 Aug 2003 09:15:40 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [127.0.0.1]) h7GGFUC7060063 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 16 Aug 2003 17:15:35 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)h7GGFUp2060062; Sat, 16 Aug 2003 17:15:30 +0100 (BST) (envelope-from matthew) Date: Sat, 16 Aug 2003 17:15:30 +0100 From: Matthew Seaman To: David Banning Message-ID: <20030816161530.GA97820@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , David Banning , questions@freebsd.org References: <4325.209.188.66.29.1060993993.squirrel@sam.skytrackercanada.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1yeeQ81UyVL57Vl7" Content-Disposition: inline In-Reply-To: <4325.209.188.66.29.1060993993.squirrel@sam.skytrackercanada.com> User-Agent: Mutt/1.5.4i X-Spam-Status: No, hits=-8.1 required=5.0 tests=AWL,EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2,REFERENCES, REPLY_WITH_QUOTES,USER_AGENT_MUTT autolearn=ham version=2.55 X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: questions@freebsd.org Subject: Re: how-to run javascript on my server X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Aug 2003 16:15:42 -0000 --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 15, 2003 at 08:33:13PM -0400, David Banning wrote: > I have some menu server java applets I would like to run on my fbsd server > but I have no idea where to get started. Some initial inquiries on Google > have not brought any luck. >=20 > Is there any sites that deal with this, or does anyone have a suggestion? You appear to have become confused between Java and Javascript. These are very different things. Javascript -- which probably should be described as ECMAScript nowadays -- is a language superficially similar to Java but that is interpreted within a web browser. Unfortunately each different brand of browser has it's own idea of what ECMAScript should be, and that makes it quite tricky to write a web page that works reasonably in any browser. See http://www.ecma-international.org/publications/standards/ECMA-262.HTM for an attempt at providing a standard and http://www-106.ibm.com/developerworks/unicode/library/wa-emca.html?dwzone= =3Dunicode for an explanation of what it is. Javascript is either incorporated directly into a web page or is served up in a separate file (traditionally with a .js suffix) referenced from the page in question. Or in other words, just slap it into the documents directory of your webserver alongside the .html files. Java on the other hand is a recent addition to the C-like language group which has the distinction of running in a virtual machine. This, together with the inherent object-orientation of the language and Sun's fanatical dedication to preserving the language standards means that *compiled* Java class files can be run unmodified on any platform that supports Java. Java is a general purpose language, and standalone Java applications are certainly available. However, most people will run into Java in the contexts of "applets". This is a mini java application that can be downloaded via a web browser and run in a limited "sandbox" context on the local machine. See for instance http://gregegan.customer.netspace.net.au/APPLETS/Applets.html for an interesting selection of mathematics oriented examples. However, what I suspect you have are the converse of that: java servlets. These are mini-applications that run as part of a web *server*. These are conceptually similar to other dynamic web languages, like PHP, ASP or some sorts of embedded mod_perl stuff, but the scope is larger: as well as the dynamic .jsp pages (which are internally converted to java code and compiled into Java servlets on the fly) there are also pre-compiled Java classes of various types. In order to serve such "webapps" to the net in general, you will need a Java servlet container. That's a webserver written in Java with all the necessary internal wiring to be able to load up the webapp object structure. There are several available in ports: the various jakarta-tomcat versions (www/jakarta-tomcat*)and Jetty (www/jetty). But wait! There's more. The webapp servlet stuff corresponds roughly to the middle (logic) tier of a 3-tier application. There's an equivalent setup "Enterprise Java Beans" which (very roughly) corresponds to the 3rd (data) layer in a 3-tier application -- the 'Java Bean' is often an object abstraction for accessing an underlying RDBMS, but it's not limited to that. [The web browser and any associated Java applets or javascript would form the 1st (presentation) layer in this concept]. See the java/jboss3 port for a freely available EJB server -- an alternative to the default J2EE stuff that Sun supplies, but which isn't actually available on FreeBSD as far as I know. Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --1yeeQ81UyVL57Vl7 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQE/PliidtESqEQa7a0RAoVOAJ9e0exxS/JnHnqMZ3cwcnQ3vWkSpwCggL3B zrfVvqsj/pROt6vzqOcbOvQ= =Mfae -----END PGP SIGNATURE----- --1yeeQ81UyVL57Vl7--