Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP application with REST server
RAP application with REST server [message #1844017] Fri, 27 August 2021 13:58 Go to next message
Magnus Konze is currently offline Magnus KonzeFriend
Messages: 13
Registered: November 2014
Junior Member
Hi,

i need to expose a REST API for my application.

Generally i can see two approaches:
- integrating the REST-"stuff" in the current application
- creating a second (non RAP) application (the REST server) which works on the same database

Is the frist approach even valid or should i expect major problems? I've written REST-APIs with Spring Boot in the past, but i'm unsure on how to get it work in a RAP application.

I played around with some tutorials (e.g. https://www.javachinna.com/creating-spring-rest-api-without-using-spring-boot/) but it didnt't work. Even the RAP application didn't work anymore (org.springframework.web.servlet.DispatcherServlet:noHandlerFound(1147) - No mapping found for HTTP request with URI [/MyApp/rwt-resources/311/rap-client.js] in DispatcherServlet with name 'dispatcher').

Any hints how to approach this? Is the separate application the way to go?
Re: RAP application with REST server [message #1844020 is a reply to message #1844017] Fri, 27 August 2021 15:13 Go to previous messageGo to next message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 192
Registered: February 2013
Senior Member
I preferred integrate https://sparkjava.com/ inside RAP application for Rest functions. This is light micro-web server and very convenient.
Re: RAP application with REST server [message #1844052 is a reply to message #1844020] Mon, 30 August 2021 08:33 Go to previous messageGo to next message
Magnus Konze is currently offline Magnus KonzeFriend
Messages: 13
Registered: November 2014
Junior Member
Thanks for the advice. Great looking framework, got it working in about an hour.

When deploying in a tomcat server you have to consider some extras, but nothing special: https://reactivedu.com/blog/deploying-spark-framework-app-to-tomcat/
Re: RAP application with REST server [message #1844081 is a reply to message #1844052] Tue, 31 August 2021 14:57 Go to previous messageGo to next message
Dmitry Dukhov is currently offline Dmitry DukhovFriend
Messages: 192
Registered: February 2013
Senior Member
stupid question but
Why are you integrating Spark with Tomcat? Spark already has a built-in web server (jetty) and doesn't depend on web servers.
Re: RAP application with REST server [message #1844137 is a reply to message #1844081] Thu, 02 September 2021 13:54 Go to previous message
Magnus Konze is currently offline Magnus KonzeFriend
Messages: 13
Registered: November 2014
Junior Member
My whole RAP-application is deployed in one war-file in a tomcat. So, when integrating Spark in the application there is no need for the built-in server.
Previous Topic:Cloning Git Repo
Next Topic:RAP app will not run from WAR file
Goto Forum:
  


Current Time: Fri Jun 14 07:11:28 GMT 2024

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

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

Back to the top