by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 22:25
    ttddyy synchronize #21689
  • 22:17
    scottfrederick commented #22736
  • 21:48
    scordio synchronize #22610
  • 21:45
    scottfrederick milestoned #22736
  • 21:45
    scottfrederick labeled #22736
  • 21:45
    scottfrederick labeled #22736
  • 21:45
    scottfrederick unlabeled #22736
  • 21:44
    scottfrederick demilestoned #22679
  • 21:44
    scottfrederick labeled #22679
  • 21:44
    scottfrederick closed #22679
  • 21:44
    scottfrederick commented #22679
  • 21:15
    philwebb transferred #22733
  • 21:13
    wilkinsona commented #22733
  • 21:12
    scottfrederick assigned #22736
  • 21:09
    wilkinsona labeled #22195
  • 21:09
    wilkinsona labeled #22195
  • 21:09
    wilkinsona unlabeled #22195
  • 21:09
    wilkinsona reopened #22195
  • 21:09
    wilkinsona commented #22195
  • 21:01
    scottfrederick labeled #22336
Phil Webb
@philwebb
especially as the String would likely need to be converted back to Boolean when it's used
Zheng Wang
@echooymxq
In some cases, people define a metadata: Map <String, Object>. with properties or yaml, It has different handling of type conversion when get the values.
I agree with you very much. This problem is more troublesome.
NicklasWallgren
@NicklasWallgren
@wilkinsona Alright, I will look into it. Thanks
Sruti
@Su-s
how we can go to the redirect page which is redirecting by the controller in reactjs frontend
@GetMapping("/admin-login")
public void adminLogin(HttpServletResponse response) {
    try {
        String url = AUTH_URL + "?" + "response_type=code" + "&" + "client_id=" + CLIENT_ID + "&" + "redirect_uri="
                + REDIRECT_URI + "&" + "scope=" + SCOPE + "&" + "state=" + UUID_;
        response.sendRedirect(url);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
here's my controller
A C SREEDHAR REDDY
@a-c-sreedhar-reddy
you could just send http response and based on that in front end you can choose to redirect or stay in the same page
Sruti
@Su-s
adminLogin = ()=> {
axios(/adminLogin, {
method: "GET",
header: {
Accept: "application/json"
}
})
.then(response => {
console.log(response);
})
.catch(error => {
console.log(error);
handleError(error);
});
this is the frontend part
A C SREEDHAR REDDY
@a-c-sreedhar-reddy
and admin-login should be post method which accepts username and password in the body
and you would authenticate and send a sessionID or JWT token as response
Sruti
@Su-s
i didnt get that
A C SREEDHAR REDDY
@a-c-sreedhar-reddy
or 401 if authentication error
Sruti
@Su-s
here im getting a cors error in frontend
Martijn Hoekstra
@martijnhoekstra
''''''
Witold Kupś
@Azbesciak
Did anyone have a problem with 414 responses via webClient? In my scenario consuming api returns HTML (nginx) default response (unexpected - it should be some kind of json), and it is even bearable - the worse is that it only occurs on production... because in my environment the request just hungs down (or response actually). I am on windows, production is on ubuntu
EugeneZakhno
@EugeneZakhno
image.png
Can you help me?
image.png
But nothing
James Howe
@OrangeDog
@EugeneZakhno this is an IntelliJ question, not a Spring Boot question. And the answer is because you haven't assigned a data source.
Stéphane Nicoll
@snicoll
:+1:
A C SREEDHAR REDDY
@a-c-sreedhar-reddy
Is there any oops functionality in spring boot controllers?
Stéphane Nicoll
@snicoll
Check spring boot actuator in the reference guide
James Howe
@OrangeDog
Is there a good way to supply different beans depending on the detected/configured db type (MySQL, PostgreSQL, etc.)?
i.e. of the autoconfigured DataSource
checking the class doesn't work e.g. if it's a Hikari one
Stéphane Nicoll
@snicoll
that’s the pooling implementation
James Howe
@OrangeDog
indeed
Stéphane Nicoll
@snicoll
you could have profile for each db and use that as a trigger
James Howe
@OrangeDog
oh, I could use DataSourceProperties.determineDriverClassName()?
this is the code that is determining a database name to then load the proper, database-specific sql script from the classpath.
Tyler Van Gorder
@tkvangorder
you should be able to use something similar to conditionally add a bean to the context .
VipinPokhriyal
@VipinPokhriyal
Hi All, can anyone suggest me how to create connection pool in couchbase,
I am using spring 5 and java8 for it.
Arthur Kazemi
@bidadh
Hi, I need to add an implicit validation to all incoming requests with specific request body or request parameter as part the request lifecycle and return 400 in it's not valid. validation definition comes as part of the request message model. we do have HttpMessageConverter<Model> which reads the message from http request so that we receive the Model in the controller method. I need to know if I can add another thing to the chain after HttpMessageConverter to handle the validation. Filter cannot be used since it is before HttpMessageConverter
Connected Softec
@connectedsoftec_twitter
ServerPropertiesAutoConfiguration missing in SpringBoot 2.2.1 ! What is the workaround/solution?
Brian Clozel
@bclozel
@connectedsoftec_twitter it's beenteh case since 2.0 and it shouldn't matter. If a library is referring to that type, maybe you need to upgrade that library too.
Arthur Kazemi
@bidadh

Hi, I need to add an implicit validation to all incoming requests with specific request body or request parameter as part the request lifecycle and return 400 in it's not valid. validation definition comes as part of the request message model. we do have HttpMessageConverter<Model> which reads the message from http request so that we receive the Model in the controller method. I need to know if I can add another thing to the chain after HttpMessageConverter to handle the validation. Filter cannot be used since it is before HttpMessageConverter

Any suggestions ? :pray:

aghag10
@aghag10
Hello! I'm seeing some issues with a class (class A) marked with Configurable annotation autowiring another class. Class A is being manually instantiated by Class X that's not Spring managed. Class A is autowiring class B. There is a delay in the instantiation order of Class A and class B. As a result, we end up hitting an NPE in class A, when it tries to invoke a method in class B. I tried debugging the issue to see in what order the 2 classes are being instantiated. I'm seeing two issues here - 1) post construct method in class A is never called 2) post construct method in class B is being called 2-3 minutes after I see a log message from an init function in class A. I've tried setting @Configurable(preconstruct = true, autowire=Autowire.BY_NAME), but no luck. Any comments/suggestions?
tahany fawzy
@tahanyFawzy1994
Hi Guys I want to get records from a many to many relationship using predicates
Vyacheslav N. Boyko
@bvn13
@aghag10 1) try to instantiate your class A by Spring itself. 2) don't use @Autowire on property private ClassB classB, turn it out to ClassA's constructor param.
Vyacheslav N. Boyko
@bvn13
@echooymxq according to https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-external-config seems Spring reads your properties and yaml in random order. So you could not predict which value will be the actual one.
Jorge
@jmanzaro

Hello! In order to do retries with a feign client, I've been following this documentation: spring-cloud-feign-overriding-defaults. It seemed to me extremely easy and I created the @Configuration class and modified the @FeignClient overriding its configuration this way:


@FeignClient(value = “service”, url = "\${service.url}", configuration = [ServiceConfig::class])
@Configuration
class ServiceConfig {
    @Bean
    fun retryFactory(): Retryer = Retryer.Default()
}

But it doesn’t work. Am I missing something? I will appreciate so much any help!

James Howe
@OrangeDog
I don't suppose there's a way to have a fallback static error page for when your normal error page fails?
I imagine it depends on the container, if it's supported at all
Stéphane Nicoll
@snicoll
@jmanzaro you’d have more luck asking this on #spring-cloud
@bvn13 I don’t see what makes you think SB loads the config in random order (it doesn’t, that url points to the order we use for loading the config)