Java Community | Help. Code. Learn.

JCH

Java Community | Help. Code. Learn.

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

Join

java-help

❓︱qotw-answers

how to store XML if i want to change its values in my service?

hey guys. in my service want to use XML. in the service Id change needed values of my XML tags. how can i do that? i was thinking about storing the XMLsomewhere, and then 'importing'/using it in my service methods. how can i do that? thanks

Spring MVC Static files

i dont know why but my browser is not adding the css file to my jsp file.. I dont Know How to resolve the issue can anyone help ?
No description

using String to represent date

hey guys. i want to have a method that accepts fromDate and toDate args. and then later in this method i will concat the args to the string:
"<FrDt>"+fromDate+"</FrDt>\n" +
"<ToDt>"+toDate+"</ToDt>\n"
"<FrDt>"+fromDate+"</FrDt>\n" +
"<ToDt>"+toDate+"</ToDt>\n"
...

Richardson Mapping With Spring Security

Hi, Im curious about, how to properly create mappings for security endpoints. I have now a UserController. So where would you like to put mappings like "login, register and verify email", to UserController or AuthController. And how would you like to create endpoints. ...

Apache Mina weird session behaviour

Hello there, I am building a CNC / Telnet server using Apache Mina and ran into some issues from the very beginng... First, I will be showing my Classes which are in the relation of the CNC... CNCServerHandler: https://pastebin.com/A5ea3AgF (Class with the username Input) CNCServer: https://pastebin.com/HEJedJ1F CNCClient: https://pastebin.com/qk2Au8Bf...
No description

Session not being created after explicitly authenticating user in spring security

I'm currently trying to implement a session based authentication using spring security and have managed to get the registration and email verification functionality working. I want the user to be authenticated after verifying their email and then be redirected to the onboarding page and then to dashboard on completion of onboarding. I have logged the authentication to console to debug and when there isn't any user then I get a console log with the authentication object containing anonymousUser and also a sessionId. But, when I explicitly try to authenticate the user, the authentication object contains all the info about the user such as principal, etc but not sessionId. any help, please? ...

Autocomplete not working

Java extension autocomplete doesn´t work VS-code

how to make my controller accept XML body?

hey guys. i have this controller: ```java GetMapping(value = "/transactions", produces = "application/xml") public String getCurrentTransactions() throws JAXBException, IOException { return bgwService.getCurrentTransactions();...

how to find my project's classpath?

hey guys. can smb in a simple manner explain how to see what is my classpath in intellij idea project? bc googling is worthless and theres no proper answer anywhere. can smb help me out? thx alot

Apache Mina

Hello there, I am building a CNC / Telnet server using Apache Mina and ran into some issues from the very beginng... First, I will be showing my Classes which are in the relation of the CNC... CNCServerHandler: https://pastebin.com/A5ea3AgF CNCServer: https://pastebin.com/HEJedJ1F CNCClient: https://pastebin.com/qk2Au8Bf...
No description

Spring MVC Suggestion

Currently I am Learning Spring MVC So should I also have to cover the part like Validation , Data Blinding , Filters , Interceptors or should I have to leave them right now and jump to spring boot ? please Mentor me .

Injecting objects into custom controls FXML

How can that be done? i cant pass it through ctor as it doesnt allow ctors with any params in fxml

started getting Class Not Found Exception randomly

hey guys. when i start my spring boot app i get this error: java.lang.ClassNotFoundException: lt.mycompany.myapp.service.XmlParserUtil. The thing is that XmlParserUtil was used just fine in this app. Now im adding new functionality, and for some reason i cant even start my app. XmlParserUtil looks like this: ```java...

how to use RFC1123 date in http header?

hey guys. can smb explain to me how to use DateTimeFormatter RFC_1123_DATE_TIME? Im making a request to the api and i need to have Date header with its value being in RFC1123 format. can smb help me out? i dont understand what to write here:
HttpHeaders headers = new HttpHeaders();
headers.set();
HttpHeaders headers = new HttpHeaders();
headers.set();
...

ClassNotFoundException

hey guys. i have this XmlParser class in my java spring app: ```java @Service public class XmlParserUtil { // code...

what is my classpath?

hey guys. i have downloaded java spring project and i need some help finding what is the classpath of it. can smb help me out? theres no info on google. thx in advance

Java mina sshd

Hi guys, I want to build an SSH server with Java mina and finally managed to get all the dependencies necessary to resolve class missing errors. Now I am encountering a new error which just blows my mind.... ```Unexpected problem occurred during version sanity check Reported exception: java.lang.AbstractMethodError: Receiver class org.slf4j.simple.SimpleServiceProvider does not define or inherit an implementation of the resolved method 'abstract java.lang.String getRequestedApiVersion()' of interface org.slf4j.spi.SLF4JServiceProvider. at org.slf4j.LoggerFactory.versionSanityCheck(LoggerFactory.java:366) at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:184)...

Maturity level rest

Hi i have a question, do you think these mappings are properly defined for maturity level? I have a controller with authentication to create Clients. /api/v1/auth: ...