FF4j Web console is not displayed properly - spring-boot

I am new to FF4J and started with hello world application.
I wrote a sample spring boot project and added dependency for ff4j-spring-boot-starter and ff4j-web modules in my pom.xml.
However, when I run the application, the FF4J web console is displayed distracted.
Below is my pom.xml and web console screenshot.
Below is the web console that I see
I am not sure what is the mistake here.
Please check and help. Thanks.

Please add "/" at end of the URL in browser. So if, the ff4j-console url is http://localhost:8080/ff4j-console it should be changed to http://localhost:8080/ff4j-console/
This resolved my problem.

Related

url after spring maven deployment

I have a basic question about deployment but I can't seem to find an answer on google...
I am working on a jakarta project and it's the first time I do the deployment.
Since I am using Spring-boot maven, I know there is an embedded tomcat that will launch with the jar.
My issue is, I don't know what url to use to check my project is working...
Before, I used the address http://localhost:9091/contextPath/endpoint, but now, I only get a whiteScreen...
So my question is, what url should I use ? Also, is there something else to do after packaging ?
Thank you for your answers.
EDIT:
Alright, so I tried actuator but that didn't help me...
With /actuator/mappings, I could see that my endpoints are correctly configured but when I use the executable jar, http://localhost:9091/contextPath/endpoint odes not work while it does if I compile with my IDE...
I don't know what url to connect to just to see the index... I'm using a very basic spring framework (boot and mvc) and my IDE is intellij community if this helps anyone
EDIT 2:
I tried to deploy the app on a local Tomcat9 to see if something would change but the connexion is reinitialized everytime I try to deploy a war using the manager, and there was no trace of error in the logs.
I tried using ./mvnw and it did work, endpoint and all, but it implies working with IDE environment
I tried using java (openjdk 13) and it compiled, but i couldn"t acces my own endpoint. I could still access the actuator endpoints so i don't know what to make of it.
Should the url be different depending on whether we are using IDE environment or just the jar?
EDIT 3:
Ok, I think have a lead but I have no idea how to resolve this:
when I began the web part of the application, I created a WEB-INF folder where I put all my jsp. My js and css files were in the resources/static folder. I tried once to put the jsp in the resources folder but it didn't work so I didn't push too hard.
Now, when I unzip the jar, i find my css and js files, but not my jsp.
When I unzip my war file, I have everything, but when I try to deploy it on a separate tomcat server, the connexion resets and I don't know why because nothing is written in the logs.
The issue then becomes:
Right now, I have
└──src
└──main
├──java
├──resources
| ├──static
| | ├──css
| | └──js
| └──template
└──webapp
└──WEB-INF
└──classes
└──jsp
What is the standard tree in intellij with jsp ?
By default Spring Boot apps are on port 8080.
Can you try http://localhost:8080?
Port can be changed in application.properties (or application.yml, application-profile.properties etc.) via server.port property (e.g. server.port=8888).
Ok, I managed to make it work.
I'm going to describe here everything of note that I encountered.
First, when I called my app to the usual url, there was no response (whiteLabel).
I added test logs and i found that I indeed called m controller.
I unzipped the jar and war i produced and came to the conclusion that the issue was architectural. I couldn't use jar, I had to use the war file.
I tried to deploy on a local tomcat server using the manager, but it always resetted the connection, so I took the manual approach - copy pasting the war file in the webapp directory.
Finally, the web pages were accessible in the browser.
Thank you for all the tips given during my research!
`http://endpoint:{PORT}/actuator/health` or `http://endpoint:{PORT}/actuator/status`
it should help but it must require spring-boot-actuator as a dependency in your pom/gradle file.

A new project using Spring Initializr does not run in browser

Building a new project downloaded using https://start.spring.io/ does not run on browser.
I have seen some solutions on stackoverflow which require to make some changes or add, but default/out-of-the-box application does not run.
I asked this in Github https://github.com/spring-projects/spring-boot/issues/20603 but was told that i need to add request mappings or something else. There's no default mapping for the root. That's indeed the default error page showing you a 404.
Is there a documentation to "add request mappings or something else" ? It will help if the application run showing some text instead of an error message. This maybe a simple obvious thing for Spring developers but for learners, takes a lot of effort.
http://localhost:8080/
STEPS TO REPRODUCE:
Download new project at https://start.spring.io/
mvn clean package
mvn spring-boot:run
That is the expected behavior right after creating a fresh Spring Boot project. The initializer does not register any endpoint for you, it just gives you the project skeleton you can start working with.
If you want to see something on localhost:8080/ consider adding the following Java class to your project:
#RestController
public class HelloWorldController {
#GetMapping
public String helloWorld() {
return "Hello World!";
}
}
If you are new to Spring/Spring Boot, I can recommend the following resources:
Official Spring Web documentation
Spring Boot Guides
Developing a CRUD API with Spring Boot YouTube course

Spring Initializr Error in Intellij Idea and STS on mac os

I have installed Intellij Idea on my macbook. When I going to create a Spring project using Spring Initializr and press "next" button, it prompts an alert window with the heading "Spring Initilizr Error", and with message body -
"Initialisation failed for 'https://start.spring.io'
Please check URL, Network and Proxy settings
Error Message
Cannot download 'https://start.spring.io':
Status 403".
I have used https://start.spring.io as Spring Initializr url, which is being set by default in Intellij Idea. I have also tried the url changing as http://start.spring.io, but it also haven't worked too.
I have tried to use Spring Tool Suit (STS) to create Spring Initializr project and got this message: "IOException: Server returned HTTP response code: 403 for URL: https://start.spring.io".
My network connection is ok and firewall is turned off too. If someone have already faced this issue, please help me with your overcoming steps. I am struggling too much with this problem and wasted enough time with it. Thanks in advance.
press Ctrl+Alt+S and search for proxy. This will show you the proxies you have set for IntelliJ; try to remove or add any.
Remember spring website will block tor.

How to set up a swagger-ui standalone server/application?

I would like to set up a standalone swagger-ui application, to view the different APIs from different servers in one central place.
In a second step I would like to customise swagger-ui to show multiple APIs at once.
I don't want to add swagger-ui to all the servers that provide swagger api-docs though.
To do so I would like to use spring boot and thought this should be an easy task. However, I have trouble getting it to work.
Here is what I did:
Generated a Spring Boot application using https://start.spring.io
included spring-boot-starter-web
added io.springfox:springfox-swagger-ui:2.3.1 dependency
When opening http://localhost:8080/swagger-ui.html I see a 404 error and UI seems broken:
Is there any reason for using Spring-boot instead of a simple web server for this?
See for example here with Nginx, including some basic authentication (pretty old link but still looking alright), or in the ReadMe of the swagger-ui github reposiory directly for easily serving with Connect/gulp-serve inside Docker (the setup can also be reproduced directly without Docker if wanted).
Also I have no idea why you're getting resources requested by the page on a different port... Just ask in case you still need help now on this topic.

Setting up home page in spring

I am new to spring environment. I have created small test spring project through STS.
Project name: SPTest
base package name: uk.co.ifTest
When I run and open this project browser through Eclipse. It work fine, but url, it put in the browser is xx.xx.xx.xx:8080/ifTest/, instead of //xx.xx.xx.xx:8080/SPTest/.
I guess, it is adding base package name.
Is there any way I can open project with http://xx.xx.xx.xx:8080/SPTest/.
Thanks
ish
You need to change your context path for the server to point from ifTest to SPTest.
This answer will help you identify how to do it:
Changing Tomcat context path of web project in Eclipse

Resources