cancel
Showing results for 
Search instead for 
Did you mean: 

CAPM 4 Java with Spring Boot: Adding UI

02-10-2020 11:00 PM
1826 views 4 comments Go to solution
SAP Managed Tags
Subscribe

Hello folks,
I'm currently trying - for learning purposes - to develop a Java (Spring Boot) based CAPM Application, which I implemented starting from this tutorial: CAP Spring Boot Walkthrough.

For me, having prior experience with Spring and Spring Boot, is the perfect starting point.

However, there is something that is bugging me and I'm not able to find anything about it: how to add a UI to the application, just like how it is done in a NodeJS based CAPM App.

It seems to me that all Spring Boot based tutorials go directly at the deploy stage, with no mention on how to create a UI for our application.
The only tutorial I have found is this one Use the SAP Cloud Application Programming Model to Create a Full-Stack App , but is pure Java based and it is implemented via WebIDE: as far as I have understood, there's no Spring Boot container coming from the CAP wizard (to get the Spring Boot container, MTA is the only option).

Am I missing something? Is there any example to follow on?

Thanks a lot,
Roberto.

Accepted Solutions (1)

Accepted Solutions (1)

mariusobert
Developer Advocate
Developer Advocate
0 Likes

Hi,

I have to admit I barely use CAP Java so I'm just guessing here. I would assume it works in the exact same way as the nodejs-flavored CAP.

You'll have to add an approuter that reroutes incoming traffic either to your CAP Java service or to the static UI files (embedded in the approuter or from the HTML5 Application Repository).

former_member231229
Participant
0 Likes

Hello Marius,
Thank you, but it is unclear to me how this setup can be tested locally. I tried this setup in WebIDE, but the Spring based service won't even start.
I really think I am missing something here 🙂

Cheers,
R.

mariusobert
Developer Advocate
Developer Advocate
0 Likes

The Web IDE tutorial that you are referring to is, as you probably already found out, outdated. My colleagues are working on an updated version, so please ignore this tutorial for now.

For local testing, you could follow the approach that I used in the Azure Cities demo app. There, I basically set up an local approuter to redirect all "CAP traffic" to another port running on localhost.

former_member231229
Participant

Marius,
Thanks a lot, it is very helpful.

All the best,
R.

Answers (0)