Java Community | Help. Code. Learn.

JCH

Java Community | Help. Code. Learn.

We are a Community full of Java developers. You can come here to connect other devs, get help, help others and do many more things!

Join

java-help

❓︱qotw-answers

Combine multiple images into a grid format with Java

I am trying to make a 2 x 4 grid view and i need to start arranging images from left to right. i have the paths inside a List<String>

help my code wont run

im useing intellij and cant get this to run
No description

Creating Anonymous Class with Set Name

When creating an expression for the scripting language Skript (https://github.com/SkriptLang/Skript) you would do: ```java public class ExprWhatever extends SimpleExpression<String> { static {...

me dumb help

why wont my code work ik the main text isnt blue but how do i make it blue so it works
No description

java.util.zip.ZipException: zip END header not found

I am currently setting up a minecraft server (1.20.1), hoster is "hosthavoc" and it requires forgejava17. The issue is that the JAR file selector of the hoster uses prefixes and doesn't seem to find the server file even tho it should be existand and I followed through the tutorial provided on their website. It currently runs (well if it ran at all) 19 mods, 3 add ons for one mod and the FTP used is filezilla ...

Help understand this spring boot code (make it better too)

```java @Controller public class CategoriesController { @Autowired private CategoryService categoryService;...

Help designin products model spring boot

I'm not really sure how to do it the right way I have products that have different sizes and colors and designs applied to them

optimize code for getting methodmodel of methods with @Select annotation

```java public static byte[] getClassBytes(Class<?> clazz) throws IOException { String classPath = clazz.getSimpleName() + ".class"; // Uses simple name for same package try (InputStream inputStream = clazz.getResourceAsStream(classPath)) { if (inputStream == null) {...

Overthinking?

I come across this sudden misconception that...if im in the middle of a project. Everything I learn from my course should be everything I should be able to use and to remember it all when dealing with a project. I always tell myself that using online references like Stackoverflow, MDN, and/or even GPT should be the last things I should resort to for assistance in needing anything to help me program. I dont know if its the pride in me thats telling me that...not using it is a major "skill issue"...

Github Authorization via pkce

I am making a github authorization via react and spring boot but i am getting 401 error while getting the access token .. React frontend : ```import React, { useEffect } from "react"; import axios from "axios";...

Authentication of independent Apis

suppose we have api/java/v1 api/express/v2 api/django/v3 ...

Springboot not serving webpage

@dan1st My Springboot app on a VM is not serving a webpage when I enter its ip and port into a browser, the browser loads and then times out. I have allowed connections on port 8080 in the firewall, but still does not work. I have confirmed it works locally. Do you have any ideas as to what the issue could be?

Help with Spring not adding to the database the entity

```java @PostMapping(value = "/admin/brands") public String addColor(@Valid @ModelAttribute(name = "brand") Brand brand, Errors errors, Model model, RedirectAttributes redirectAttributes) { if (errors.hasErrors()) { model.addAttribute(brand);...

Entity to Domain class

What is the best way to instantiate a domain class from the database entity class, when there are many of these that share the same attribute? For example, a fraction of the students share the same school, and if i were to create a new school for each, that would be having many instances of the same school, instead of a single one....

pass an instance

how can i pass an instance of this class into the main class ```public class PetGoal implements Goal<Mob>, Listener { private final GoalKey<Mob> key = GoalKey.of(Mob.class, new NamespacedKey("firstplugin", "key")); private final Mob mob; private final LivingEntity owner;...

How can I make this more efficient?

I have this code snippet that finds matching records based on composite key string and it is very slow. Is there a better way to do this? Main method: ```private Set<SomeObjectCompositeKey> existingValues(Set<SomeObjectCompositeKey> existingValuesBatched) { Set<String> stringCompositeKeys = toStringCompositeKeys(existingValuesBatched);...

How save Blog article

Hey there, my app has the feature that you can write knowledge blog article and publish it, other user can read it so. In which format should I save it to grant a structure of title, paragraph, subheader, image, paragraph, table or list and saving textformtting such as cursive or bold?

Oauth2 client

Is this behavior normal? after login success and token exchange , client removed session and i have to login again...
No description

SPRING SECURITY

hi guys, ive just started learning about spring securit and i have some question about it. i just add 2 type of authentication regular auth (email + password) and oauth that return a JWT, my problem is those authentication cant be use at the same time, i have to add @Order(1) for specify which auth will be used, even after i changed the api route to be different each others. are there any suggestions for my case? or even is it possible to implement this approach? because i've implemented that...