GithubHelp home page GithubHelp logo

loda-kun / spring-boot-learning Goto Github PK

View Code? Open in Web Editor NEW
1.6K 1.6K 981.0 1.04 MB

🍀 Hướng dẫn tất tần tật về Spring Boot, Spring Cloud ☘️ Code mẫu tiếng việt, có bài viết hướng dẫn đi kèm hình ảnh dễ hiểu 🍄

Home Page: https://loda.me

License: MIT License

Java 96.53% HTML 3.45% CSS 0.02%

spring-boot-learning's Issues

Disable session on JWT demo

In your demo of JWT hibernate, It is necessary to disable the session, so that API can be truthly stateless. Otherwise, the cookies will be use to authenticate. That it can get the resource without using the token after login
https://github.com/loda-kun/spring-boot-learning/blob/master/spring-security-hibernate-jwt/src/main/java/me/loda/springsecurityhibernatejwt/WebSecurityConfig.java
@OverRide
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.cors() // Ngăn chặn request từ một domain khác
.and()
.authorizeRequests()
.antMatchers("/api/login").permitAll() // Cho phép tất cả mọi người truy cập vào địa chỉ này
.anyRequest().authenticated()
.and()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS);; // Tất cả các request khác đều cần phải xác thực mới được truy cập

    // Thêm một lớp Filter kiểm tra jwt
    http.addFilterBefore(jwtAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class);
}

'artifactId' with value 'sub-project-name' does not match a valid id pattern.

Minh clone thử thì thấy nhiều project bị maven báo lỗi,
thường là kiểu này như trên title, một ví dụ là thế này

'artifactId' with value 'spring-boot-helloworld-@Primary - @Qualifier' does not match a valid id pattern.

Mình nghĩ là do @ là ký tự đặc biệt chăng.
Mình newbie và không rõ là mọi người có bị vấn đề này không?

spring-boot-swagger3-openapi3

Sao ở project này sao mình không chạy được swagger được vậy bạn nhỉ. url mình định nghĩa chỗ nào vậy. Nhờ hướng dẫn giúp

Could not resolve placeholder 'loda.mysql.url' in value "${loda.mysql.url}"

Mình đang làm theo https://github.com/loda-kun/spring-boot-learning/tree/master/spring-boot-7-spring-application-properties-%40Value

mà khi chạy thì bị lỗi

Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'loda.mysql.url' in value "${loda.mysql.url}" at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:172) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:124) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:237) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:211) ~[spring-core-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:175) ~[spring-context-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:839) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1083) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1062) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:583) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372) ~[spring-beans-5.0.9.RELEASE.jar:5.0.9.RELEASE] ... 17 common frames omitted

Có bạn nào biết sửa lỗi này không?

bổ sung readme

Cảm ơn bạn đã chia sẻ. nhưng cái phần org.hibernate ở đâu vậy bạn? không để text copy cho nhanh, để ảnh không copy được.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.