Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Orion (Archived) » Servlet in Orion server(Servlet in Orion server)
Servlet in Orion server [message #1037981] Wed, 10 April 2013 08:49 Go to next message
Tsahar Sobe is currently offline Tsahar SobeFriend
Messages: 8
Registered: April 2013
Junior Member
Hi,
We are using Orion client and server.
We have downloaded the source code to eclipse IDE.
We need to do the following sequence:
User writes code in the Orion editor->user clicks on a button->http request is being sent to the Orion server->Orion server should notify via http to another server.

I need to implement the code that listen in the Orion server to the http request from the editor and send and http request to the other server.
We thought on doing it by adding a new servlet to org.eclipse.orion.server.servlets.
My servlet name is :serverNew.js and it contains a doGet function.

How do I run a servlet in Orion? I don't understand how should the serverNew.js and the doGet function should be run? What is the mechanism?
As far as I know we should configure a key/value in some xml, is this is the case here? If yes where should I do it?
I saw that there is a NewFileServlet.java servlet with doGet, but I don't understand how does the doGet is being activated?

Also, is there an API to work with servlets in Orion?

Thank you very much,
Tsahar
Re: Servlet in Orion server [message #1041862 is a reply to message #1037981] Mon, 15 April 2013 17:19 Go to previous message
John Arthorne is currently offline John ArthorneFriend
Messages: 176
Registered: July 2009
Senior Member
For this use case, a servlet filter is better. Each servlet handles requests against a particular resource path, like /file, /search, etc. A filter lets you intercept requests to some path and do some pre- or post-processing. Most of the details here are just standard Java EE programming and don't require any special knowledge of Orion. You can start by looking at the Java EE documentation for details:

http://docs.oracle.com/javaee/5/api/javax/servlet/Filter.html

There are quite a few filter implementations in Orion that you can also take a look at. A very simple example is WelcomeFileFilter, which redirects requests ending in a slash (/) to index.html.

John
Previous Topic:History of Orion
Next Topic:ISecurePreferences storage
Goto Forum:
  


Current Time: Fri Apr 19 10:04:24 GMT 2024

Powered by FUDForum. Page generated in 0.01560 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top