As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Actually I want to develop a simple servlet container like tomcat. It's purely my learning purpose. It would be very helpful if anyone can help and guide me where to start actually.
Thanks in advance.
First, study the Java Servlet API (fundementals) to understand to understand the lifecycle of the Servlet. Now, we're on Servlet 3 specification (The Latest Tomcat) so you will have to decide which version of Servlet API you want to implement.
Aside from studying the Servlet API you can grab tomcat's source code and read it. Start by doing something very very simple, like write a container that is capable of accepting Http request.
Start with Socket Programming. How server listen to request on port 80.
Then Start the Request Handler. How the request from the client will be treated and then send the response to the client.
Start it with single threaded environment and then go to multi-Threaded environment. To receive request from different clients.
Then you can start keeping sessions and so on...
Hope it will help you.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've got bunch of applications in .NET technologies: desktop in winforms, web in ASP.NET. I will have also a webpage wirtten in JSF. All these applications work with the same database (or databases). My problem is that all these application connect to the database (or will connect) on their own.
I want to create a gateway which will have only access to database. Other applications (in .NET and Java) will use it to get data from database. And I'm wondering which technology will be the best, for .NET and Java.
I've have to tell that I don't have much experience with Java, so I need a little help on this.
You basically want to create a server that encapsulates your database. This server should be used from different programming languages.
Your goal should be to use a technology that is easiy usable in these different languages.
A web-service - either using SOAP or being RESTful - comes to mind here.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm building my own web service client data binding mechanism customized for my client. I would like to build my own SOAP message on the request and receive the SOAP message response. I started writing a client directly interacting with the socket, but started getting hung up with the complexities of WS-Security. Any ideas on libraries and/or approaches for this project?
What makes you think that you need custom bindings? Probably those tested with 1000-s of developers are quite mature.
Take a look at Apache CXF. Go through architecture documentation. You may find an extension point there suitable for your needs.
Apache CXF currently supported data bindings: JAXB 2.x (default), Aegis, Apache XMLBeans, Service Data Objects (SDO) and JiBX (under development). If any of those doesn't fit your needs attach your own following data binding architecture docs.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I need to create SOAP web service without using some web server(apache, jetty, ...).
javax.jws.WebService seems best option, but I know how it work in production mode.
Someone using javax.jws.WebService? It will be work with 100 online users?
Maybe some advise about other web service options?
Thanks!
It can easily support 100 users, rather you will need to make it support 100 users ;)
You can implement the webservice without webservers but then you will end up coding all the features that the webserver's provide to you like:
-- Multiple request processing or scalability
-- Authentication, authorization, auditing.
I you could tell me why do you want to hand code the webservice platform it would be helpful.
Some WebServers can run in embedded mode (jetty for example).
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I want to code a server daemon application that provides some backend functionality. I'd like to stick to Java since I'm pretty familiar with this language and I figure it'd be much easier to just dig into a new framework and not a new language in parallel.
So far I found many promising frameworks, but all of them resemble somehow a webserver. Thing is, I don't want to code a web-application in terms of web-sites so I doubt that I'll need all the webserver-functionality such as templates and this stuff.
What would be a good suggestion for this purpose or would using a regular web-framework such as "play" without the template-stuff be the best choice?
JAX-WS is a standard for creating SOAP web services. Wikipedia link to see what it is about.
For RESTful you would need to make http requests, usually get and post and this type of service works best if you develop a website. From what I understand you don't want this, but still if ever just check the spring framework.
Raw TCP/IP is so much harder and unless you know exactly what you want (performance and optimization wise) you`re better off using a framework.
A webserver is used to implement webservices. A webserver may serve more than html to clients.
I have a personal "stack" using for a long time that is Jetty + RESTEasy and it serves no html at all (only XML and Json).
Javascript + Rest (Glassfish + Jersey for rest). Glassfish – Java EE Full profile certified reference application server (server will used for REST host).
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
What are the main differences between CGI and Java servlets?
Servlets are run in one process (HTTP server with additional features, which called Servlet Container) and they exist as long as that process exists.
CGI means every time there's client request, HTTP server creates new instance of process to serve this request. This is performance killer. Additionally, since there's new process per each request, it means CGI can't aggregate data from several requests in memory, as Servlets can, and must resort to external persistent storage (file or DB). This is performance killer as well.
Biggest difference is that CGI died a decade+ ago.
Servlets are a standard, Java CGI never really was.
Java servlets run in some kind of container (Tomcat, JBoss, Glassfish, Jetty etc) which needs to be running to serve request.
CGI normally spawns a new process for each request which (considering starting a JVM is somewhat expensive) is not the best solution for Java.
At a minimum, using Java servlets in a servlet container should provide better performance. Using any type of CGI with Java is most likely having to spawn new Java processes for each request, which is less than ideal. In working with Java on the server-side from the web, using Servlets is really the best approach.