Showing posts with label Jetty. Show all posts
Showing posts with label Jetty. Show all posts

Wednesday, September 17, 2014

Jetty file server refresher


Jetty HTTP server has left MortBay for Eclipse and since version 9.1 there are some things that I needed to know when I looked to take a little Jetty refresher.

Over at jetty you will see this important note:

Demo Base

Since release 9.1.0, the jetty distribution does not deploy any demo web applications, so to see a more interesting demonstration of the server you need to run from the demo-base directory as follows:
> cd $JETTY_HOME/demo-base/
> java -jar ../start.jar  
...
Pointing a browser at http://localhost:8080, will now show a welcome page and several demo/test web applications.
What that meant in my case on Win7 when running cmd from my own jetty install directory 
cd demo-base
java -jar ../start.jar
which then gave me the full Jetty demo at
localhost:8080



Monday, October 12, 2009

curlgen using Rebol QuarterMaster

Over at aule-browser.com I have the 3.11 version of Rebol QuarterMaster generating some Curl web content.

Two minor changes were required to tweak the qm.r source for the Content-Type to be "text/vnd.curl" and to share Apache with other web frameworks.  As with Django, you will need the final forward slash on the URL paths such as /qm/ or /macros/.

The QuarterMaster file structure is quite plain by the time you are 2 levels deep and it lies outside my web container. The lower level is the expected ./controllers and ./models and ./views that you would expect with a web-style MVC framework.  Compared to Django on the same host, there was minimal configuration required.

The Curl code that you see at aule-browser.com/qm/ resides in an RSP file within the views/pages folder which reflects this QM install being configured to use a pages controller.  That code resides in ./controllers/pages.r and is simply:
REBOL [   title: "Pages Controller"
  type: 'controller
  default: "index"
]
action "index" does [
    render %welcome.rsp]
If you are not familiar with Rebol, it is (among other uses) the scripting language of the Syllable operating system and is currently in alpha-88 and moving towards a beta for version 3.0 at http://www.rebol.net/

Like ICON and Curl, Rebol is a reflective expression-based object language but without ICON's keywords.
While recently ObjectIcon has brought a ICON dialect up to UNICODE, Rebol will be UNICODE with version 3.0 and will have modular facilities suited to PITL.  Curl, of course, has had both since its inception almost a decade ago.

Rebol3 will see various extensions to parse which is how Rebol scans a string or series datatype.  And like ICON, Rebol has many data types: I count 58 at this point of the Rebol3 alpha.  In Rebol, the values have the data types and an effort has been made to provide useful types for web development, such as tag! and url!

When Rebol3 goes to beta, the author of QuarterMaster can be expected to release a new version.

When all was said and done, less effort was required to get QuarterMaster generating Curl than was required to get the same result from Django at www.aule-browser/macros/ (which is intended eventually to showcase Curl macros).

If you would like to try QuarterMaster on a localhost, I would sugggest either Jetty or the Cheyenne Rebol server. I should note that Syllable Server's documentation states that it includes the "QuarterMaster web application framework, configured to run on Cheyenne." and, at a glance, I would guess that http://www.syllable.org/ is itself running on QuarterMaster.

Tuesday, August 7, 2007

RIFE-Jumpstart

RIFE is such a terrific example of using continuations in a web application framework that it is too bad if giving it a try has glitches from the get-go.
The RIFE-Jumpstart will use Jetty so you will want to go into the Jetty subfolder and edit the jetty.xml such that the port value is something other than 8080. After that you will reach RIFE as something like
http://localhost:28282
You simply must confirm that your OS has the JAVA_HOME env variable set to a JDK. I am using RIFE for Java5 so mine set to
i:\java5\jdk
I tried using my own ClassPath tool from LogiqueWerks to get around this by being sure to hit the right tools.jar and javac.exe but I could not escape
class file has wrong version 49.0, should be 48.0
when launching from the RIFE-JUMPSTART directory with
ant run
This also means that you must have ant in your path.
It is annoying that most HTTP frameworks install without politely asking for an alternative to port 8080. OracleXE and SUN Application Server are the latest to do this to me.
There are some good video podcasts on RIFE - one at Google is about an hour long.
If I add some RIFE pages they will be over at eclectic-pencil.com Useful links include rifers.org and a Confluence link on DWR.

Saturday, June 9, 2007

Jetty Lift Scala Tutorial for Windows XP

First install Jetty as a web server.
Open a cmd session in that Jetty directory (for this I use Microsoft PowerToys "Open Command Window" tool.)
In that cmd session, execute
java -cp . -jar start.jar

Open an IE browser and enter the address http://localhost:8080
When the web page comes up, click the Jetty test link
Go to the cmd window and enter CTRL-c to stop jetty

Now install Lift if you have not already done so.
Copy the Lift JAR file to jetty\lib
Copy the Lift Examples WAR file to jetty\webapps
restart jetty
refresh the localhost web page with the F5 key
This time click the Lift Examples link

Welcome to Lift on Jetty