C++ Wt with Java server

Added by Dimitris Menounos about 1 month ago

Hi, I am a Wt newbie and I would like to ask a theoretical question.

I am interested to use the C++ Wt framework, however, in the context of a Java server like Apache Tomcat. Ideally Wt would include only the part that handles the life cycle of the component hierarchy, without auxiliary stuff like dbo, auth etc. The Java server would handle the HTTP request / response objects and communicate with Wt over some kind of a bridge layer. Also ideally Wt would be able to read and write values in the java request / session / application scopes.

Do you think that idea would be feasible?


Replies (4)

RE: C++ Wt with Java server - Added by Derek Spenser about 1 month ago


Wt has a Java port called JWt (https://www.webtoolkit.eu/jwt). Here is the description from the user guide (https://www.webtoolkit.eu/jwt/latest/doc/userguide/userguide.html):

JWt is a Java library for developing web applications. The library uses the standard Java Servlet infrastructure, and therefore, a JWt web application may be deployed in existing servlet containers or JEE web application servers.

Would JWt work better for your project(s)?

RE: C++ Wt with Java server - Added by Wim Dumon about 1 month ago

I must admit that JWt was also the first thing that came to my mind. JWt is very much alike to Wt, but then in Java instead of C++. Feature wise, it is an almost identical copy.


RE: C++ Wt with Java server - Added by Dimitris Menounos about 1 month ago

Indeed JWt looks like the more reasonable solution. However, it is the C++ language that is intriguing to me. Also if I have to use a Java solution there exist more established frameworks to choose from such as JSF, Wicket, etc.

Answering my own question, the bridge layer already exists, it is FastCGI (duh!). I have found that Jetty supports FastCGI [[http://www.eclipse.org/jetty/documentation/9.4.3.v20170317/fastcgi.html]] and also another solution that looks more cross platform [[http://jfastcgi.org/]]. JFastCGI presumably allows for fastcgi integration through a portlet, which is exactly what I would like to accomplish.


RE: C++ Wt with Java server - Added by Koen Deforche about 1 month ago

Hey Dimitris,

There are also reverse-proxy implementations that run in a Java application server that can then talk to a wthttpd instance. That is preferable over FastCGI (which is a dying protocol).
Indeed in Java there are many options, but we happen to believe that JWt is really the better choice for complex/long-term maintainable (to us the language, C++ or Java, isn't the essential appealing feature of the toolkit).