Java Community | Help. Code. Learn.

JCH

Java Community | Help. Code. Learn.

With more than 25,000 members, join one of the biggest and most active Java Communities on Discord! ☕

Join

java-help

❓︱qotw-answers

Code Review Request

Hello! Does anyone have a moment to review my code? I have made a very simple project similar to Google Dropbox / the explorer with Spring Boot and Spring Security. Please look over the file structure, as I am trying to follow the Service-Controller-Repo structure. Otherwise please give me suggestions on how I can improve my overall code! Thanks! GITHUB PROJECT LINK: https://github.com/De1ora/FolderAPI...

How can i add discord login

I wanted to add login with discord to my website and im using react in the frontend and spring in the backend, what should be the best way to implement this?

DispatcherServlet Class Not Found Exception Again and Again

I have created a Spring MVC project where I used: jakarta 6.0 and spring-webmvc 6.2 in pom.xml Dynamic Web Module 5 JDK 23 ...

@MapsId not works

I have two entities as below, and I would like the "cart" entity to have the same id as the Customer entity of its respective relationship @Entity @NoArgsConstructor...

Spring security returning 401 with requestmatchers permitAll

When i try registering a new user it only works if i pass credentials of an user that is already registered through basic auth. If i try passing a register user request without auth it returns 401. security config: ```java...

Spring security: get user from implementation of UserDetails from Authorization

Im trying to extract the user of a request through the Authorization object. this is my implementation of UserDetails: ```java...

can request be validated before reaching the controller?

hey guys. im talking with a friend of mine and he mentioned that in php language you usually validate the data BEFORE it reaches the controller. i was wondering if this can be done in Java Spring app? as i understand this idea cant be done in Java Spring app. the controller in Spring app is the entry point to the application. and you cant really do much in Dispatcher servlet. what do you guys think? thanks in advance.

Can not open .Jar

So im trying to open a .jar file to make a minecraft server for me and my friends but when i got in to cmd and put in java -jar Server.jar i keep getting Error: Unable to access jarfile Server.jar.

im a begginer in java and im trynna make a mod in mc with intelj

i get this error when i run runClient Build file 'C:\MyModProject\build.gradle' line: 156 Could not determine the dependencies of task ':classes'....

Performance & Readability Improvements

I do have quite big classes, I wanted to break them down into smaller classes but i entered issues while doing that. My goal is better readability, equal performance compared to now when all modules enabled and better performance than now when all modules disabled. Im trying to avoid class loading,initialisation and registration of handlers that arent needed aswell as them registrated multiple times. For example if i have a field that controls whether a module is going to be loaded or not, but the field also needed for a module and changing during runtime, then i have basically one part of the module i the class that refers execution to modules and one part in the module class, which doesnt look good. Also if i have smaller classes i need more total time to load these and they consume more file size and metaspace memory? I also noticed if i load on demand that i will get minor lag spikes. If i though keep them in big classes then i will have the best performance when everything is used and loaded but bad performance when only a fraction is enabled....

Roles & SecurityConfig

Hello so i have 3 roles ```java public enum Role { ADMIN, STAFF,...

Javafx Not importing

i have tried to follow yt but i thing i have done something wrong. the code is from GPT and i need it for my clg project. Is anyone willing to help?
No description

keyloack backchannel communicate in bff architect

how i can update keyloack from 24 to 26 , maybe KC_HOSTNAME_URL not avaiable in version 26 ```keycloak: container_name: lamapuz-bff.auth image: quay.io/keycloak/keycloak:24.0.0 command: - start-dev...

question about Java

I am reading that when Java was first introduced, the developers and designers anticipated that Java GUI programming would be the most predominant form of Java programming, even eclipsing other forms of windows programming (such as C++ and toolkits). What are some reasons for why this did not happen?

VS Code not executing program

I'm trying to run a simple program (no errors with the code itself) but whenever I go to run the program I get this error.
No description

Ayuden, por favor

¿Qué medidas de seguridad se deben implementar para proteger los datos de los usuarios?

Ayuden, por favor

¿Qué medidas de seguridad se deben implementar para proteger los datos de los usuarios?

Websocket Postman

I just wanted to check if someone notice anything wrong in my code. Basically, what I want to do is that when a new user registers, I want the admins to be notified with "New user has been registered", but I want to do it in real-time using WebSocket. I'm testing my WebSocket URL ws://localhost:8080/ws, and I successfully connect to it. I also subscribe to the destination: ```SUBSCRIBE...

instance

```public class CooldownManager { private final Map<UUID, Instant> map = new HashMap<>(); // Set cooldown public void setCooldown(UUID key, Duration duration) {...
Next