Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there Comparable alternatives to Java Servlets?

Tags:

servlets

I understand that a servlet is an actual class in Java that basically extends and provides useful characteristics of a web server, but are there any alternative equivalents where the same similar key characteristics of a servlet are accomplished in a different language?

Particularly something that has:

  • the servlet life cycle of init(), service() and remove()
  • limitations on disk access (persistence)
  • performing page layout function
  • can be dynamically reloaded
  • can call other servlets
  • can operate like a URL
  • similar security

I have found servlets in AJAX, Spring and the like, but I mean something that is not in the java family at all. To specify further, I found the following but they don't seem to be used very much, both run over Java, and Armed Bear C-Lisp seems still employs a java virtual machine.

  • node-servlet

  • armed bear common lisp

like image 484
Chris Marie Avatar asked Aug 04 '14 04:08

Chris Marie


People also ask

Is Java Servlet obsolete?

Servlets are still used as the basis for web frameworks (though many are moving to netty now). Jsp is less useful unless you have to work with old code, newer templating frameworks are just better.

Are servlets and JSP still used nowadays?

One of the original Java web technologies, JSP is still widely used with servlets and JSTL.

Is JSP better than servlet?

A. In terms of coding language, JSP is superior to Servlets since it can be written in only one language: Java; on the other hand, while building a Servlet program, it must first be written in HTML format. Then at the time of compilation, it is converted to Java.


1 Answers

There are quite a number of servlet alternative since servlet is just an implementation of HTTP request and response mechanism based on Java.

Almost all languages has a mechanism to deal with HTTP methods. They just not called 'servlet'. For example node.js has great tools for this. Have a look at express.js which is arguable most used node.js framework.

Make a google search like this: "x rest server" and use whatever language you want instead of 'x', you will most likely get what you asked for. Let's try it for a couple of languages:

ruby rest server : sinatra, grape
swift rest server : kitura, perfect, vapor
c# rest server : web api, servicestack 
javascript rest server : node.js, express.js, hapi.js
phyton rest server : django, flash
like image 63
Ramazan Polat Avatar answered Sep 21 '22 16:09

Ramazan Polat