最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

SpringBoot請(qǐng)求映射的五種優(yōu)化方式小結(jié)

 更新時(shí)間:2025年06月12日 10:27:01   作者:風(fēng)象南  
在Spring?Boot應(yīng)用開(kāi)發(fā)中,請(qǐng)求映射(Request?Mapping)是將HTTP請(qǐng)求路由到相應(yīng)控制器方法的核心機(jī)制,合理優(yōu)化請(qǐng)求映射不僅可以提升應(yīng)用性能,還能改善代碼結(jié)構(gòu),增強(qiáng)API的可維護(hù)性和可擴(kuò)展性,本文將介紹5種Spring?Boot請(qǐng)求映射優(yōu)化方式,需要的朋友可以參考下

一、REST風(fēng)格路徑設(shè)計(jì)與命名優(yōu)化

1.1 基本原理

REST(Representational State Transfer)是一種軟件架構(gòu)風(fēng)格,強(qiáng)調(diào)使用標(biāo)準(zhǔn)HTTP方法(GET、POST、PUT、DELETE等)對(duì)資源進(jìn)行操作。合理設(shè)計(jì)REST風(fēng)格的API路徑可以使接口更直觀、更易用。

1.2 實(shí)現(xiàn)方式

1. 使用適當(dāng)?shù)腍TTP方法:

@RestController
@RequestMapping("/api/users")
public class UserController {
    
    // 獲取用戶列表
    @GetMapping
    public List<User> getAllUsers() {
        return userService.findAll();
    }
    
    // 獲取單個(gè)用戶
    @GetMapping("/{id}")
    public User getUser(@PathVariable Long id) {
        return userService.findById(id);
    }
    
    // 創(chuàng)建用戶
    @PostMapping
    public User createUser(@RequestBody User user) {
        return userService.save(user);
    }
    
    // 更新用戶
    @PutMapping("/{id}")
    public User updateUser(@PathVariable Long id, @RequestBody User user) {
        return userService.update(id, user);
    }
    
    // 刪除用戶
    @DeleteMapping("/{id}")
    public void deleteUser(@PathVariable Long id) {
        userService.delete(id);
    }
}

2. 資源命名規(guī)范:

  • 使用名詞復(fù)數(shù)表示資源集合(如/users而非/user
  • 使用嵌套路徑表示資源關(guān)系(如/users/{userId}/orders/{orderId}
  • 避免使用動(dòng)詞(使用HTTP方法代替)

3. 版本控制:

@RestController
@RequestMapping("/api/v1/users")  // 在URL中包含版本號(hào)
public class UserControllerV1 {
    // 控制器方法...
}

@RestController
@RequestMapping("/api/v2/users")  // V2版本API
public class UserControllerV2 {
    // 控制器方法...
}

1.3 優(yōu)缺點(diǎn)與適用場(chǎng)景

優(yōu)點(diǎn):

  • 提高API的可讀性和可理解性
  • 符合HTTP語(yǔ)義,更易于被客戶端正確使用
  • 便于API文檔生成和客戶端代碼生成

缺點(diǎn):

  • 對(duì)于復(fù)雜業(yè)務(wù)場(chǎng)景,純REST設(shè)計(jì)可能不夠靈活
  • 需要團(tuán)隊(duì)成員對(duì)REST理念有一致理解

適用場(chǎng)景:

  • 公開(kāi)API設(shè)計(jì)
  • 微服務(wù)間通信
  • 需要長(zhǎng)期維護(hù)的企業(yè)級(jí)應(yīng)用

二、請(qǐng)求參數(shù)綁定與路徑變量?jī)?yōu)化

2.1 基本原理

Spring Boot提供了強(qiáng)大的參數(shù)綁定機(jī)制,可以將HTTP請(qǐng)求中的參數(shù)、路徑變量、請(qǐng)求頭等信息綁定到控制器方法的參數(shù)中。優(yōu)化這些綁定方式可以簡(jiǎn)化代碼,提高開(kāi)發(fā)效率。

2.2 實(shí)現(xiàn)方式

1. 路徑變量(Path Variables):

@GetMapping("/users/{id}/roles/{roleId}")
public Role getUserRole(
        @PathVariable("id") Long userId,
        @PathVariable Long roleId) {  // 變量名匹配時(shí)可省略注解的value屬性
    return userService.findUserRole(userId, roleId);
}

2. 請(qǐng)求參數(shù)(Request Parameters):

@GetMapping("/users")
public List<User> searchUsers(
        @RequestParam(required = false, defaultValue = "") String name,
        @RequestParam(required = false) Integer age,
        @RequestParam(defaultValue = "0") int page,
        @RequestParam(defaultValue = "20") int size) {
    return userService.searchUsers(name, age, page, size);
}

3. 使用對(duì)象綁定復(fù)雜參數(shù):

// 使用DTO封裝搜索參數(shù)
@Data
public class UserSearchDTO {
    private String name;
    private Integer age;
    private Integer page = 0;
    private Integer size = 20;
}

@GetMapping("/users/search")
public List<User> searchUsers(UserSearchDTO searchDTO) {
    // Spring自動(dòng)將請(qǐng)求參數(shù)綁定到DTO對(duì)象
    return userService.searchUsers(
            searchDTO.getName(),
            searchDTO.getAge(),
            searchDTO.getPage(),
            searchDTO.getSize());
}

4. 矩陣變量(Matrix Variables):

// 啟用矩陣變量支持
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
        UrlPathHelper urlPathHelper = new UrlPathHelper();
        urlPathHelper.setRemoveSemicolonContent(false);
        configurer.setUrlPathHelper(urlPathHelper);
    }
}

// 使用矩陣變量
@GetMapping("/users/{userId}/books")
public List<Book> getUserBooks(
        @PathVariable Long userId,
        @MatrixVariable(name = "category", pathVar = "userId") List<String> categories,
        @MatrixVariable(name = "year", pathVar = "userId") Integer year) {
    // 處理如 /users/42;category=fiction,science;year=2023/books 的請(qǐng)求
    return bookService.findUserBooks(userId, categories, year);
}

2.3 優(yōu)缺點(diǎn)與適用場(chǎng)景

優(yōu)點(diǎn):

  • 減少樣板代碼,提高開(kāi)發(fā)效率
  • 提供類型轉(zhuǎn)換和校驗(yàn)功能
  • 支持復(fù)雜參數(shù)結(jié)構(gòu)

缺點(diǎn):

  • 過(guò)于復(fù)雜的參數(shù)綁定可能降低API的可讀性
  • 自定義綁定邏輯需要額外配置

適用場(chǎng)景:

  • 需要處理復(fù)雜查詢條件的API
  • 需要進(jìn)行參數(shù)校驗(yàn)的場(chǎng)景
  • 多層次資源訪問(wèn)路徑

三、HandlerMapping自定義與優(yōu)化

3.1 基本原理

Spring MVC使用HandlerMapping組件將HTTP請(qǐng)求映射到處理器(通常是控制器方法)。通過(guò)自定義HandlerMapping,可以實(shí)現(xiàn)更靈活的請(qǐng)求路由策略,滿足特定業(yè)務(wù)需求。

3.2 實(shí)現(xiàn)方式

1. 自定義RequestMappingHandlerMapping:

@Component
public class CustomRequestMappingHandlerMapping extends RequestMappingHandlerMapping {
    
    @Override
    protected RequestMappingInfo getMappingForMethod(Method method, Class<?> handlerType) {
        RequestMappingInfo mappingInfo = super.getMappingForMethod(method, handlerType);
        if (mappingInfo == null) {
            return null;
        }
        
        // 獲取類上的租戶注解
        MultiTenancy tenancy = AnnotationUtils.findAnnotation(handlerType, MultiTenancy.class);
        if (tenancy != null) {
            // 添加租戶前綴到所有映射路徑
            return RequestMappingInfo
                    .paths("/tenant/{tenantId}")
                    .options(mappingInfo.getOptionsResolver())
                    .build()
                    .combine(mappingInfo);
        }
        
        return mappingInfo;
    }
}

2. 配置HandlerMapping優(yōu)先級(jí):

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    
    @Autowired
    private CustomRequestMappingHandlerMapping customMapping;
    
    @Bean
    public HandlerMapping customHandlerMapping() {
        return customMapping;
    }
    
    @Override
    public void configureHandlerMapping(HandlerMappingRegistry registry) {
        registry.add(customHandlerMapping());
    }
}

3. 動(dòng)態(tài)注冊(cè)映射:

@Component
public class DynamicMappingRegistrar implements ApplicationListener<ContextRefreshedEvent> {
    
    @Autowired
    private RequestMappingHandlerMapping requestMappingHandlerMapping;
    
    @Autowired
    private ApplicationContext applicationContext;
    
    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        // 從數(shù)據(jù)庫(kù)或配置中心加載動(dòng)態(tài)端點(diǎn)配置
        List<DynamicEndpoint> endpoints = loadDynamicEndpoints();
        
        // 創(chuàng)建動(dòng)態(tài)處理器
        Object handler = new DynamicRequestHandler();
        
        for (DynamicEndpoint endpoint : endpoints) {
            // 創(chuàng)建請(qǐng)求映射信息
            RequestMappingInfo mappingInfo = RequestMappingInfo
                    .paths(endpoint.getPath())
                    .methods(RequestMethod.valueOf(endpoint.getMethod()))
                    .produces(MediaType.APPLICATION_JSON_VALUE)
                    .build();
            
            // 注冊(cè)映射
            requestMappingHandlerMapping.registerMapping(
                    mappingInfo,
                    handler,
                    DynamicRequestHandler.class.getMethod("handleRequest", HttpServletRequest.class)
            );
        }
    }
    
    private List<DynamicEndpoint> loadDynamicEndpoints() {
        // 從數(shù)據(jù)庫(kù)或配置中心加載
        return List.of(
                new DynamicEndpoint("/dynamic/endpoint1", "GET"),
                new DynamicEndpoint("/dynamic/endpoint2", "POST")
        );
    }
}

@Data
class DynamicEndpoint {
    private String path;
    private String method;
    
    public DynamicEndpoint(String path, String method) {
        this.path = path;
        this.method = method;
    }
}

class DynamicRequestHandler {
    public ResponseEntity<Object> handleRequest(HttpServletRequest request) {
        // 動(dòng)態(tài)處理請(qǐng)求邏輯
        return ResponseEntity.ok(Map.of("path", request.getRequestURI()));
    }
}

3.3 優(yōu)缺點(diǎn)與適用場(chǎng)景

優(yōu)點(diǎn):

  • 支持高度自定義的請(qǐng)求路由邏輯
  • 可以實(shí)現(xiàn)動(dòng)態(tài)注冊(cè)和更新API端點(diǎn)
  • 可以添加橫切關(guān)注點(diǎn)(如租戶隔離、API版本控制)

缺點(diǎn):

  • 實(shí)現(xiàn)復(fù)雜,需要深入理解Spring MVC的內(nèi)部機(jī)制
  • 可能影響應(yīng)用啟動(dòng)性能
  • 調(diào)試和維護(hù)成本較高

適用場(chǎng)景:

  • 多租戶應(yīng)用
  • 需要?jiǎng)討B(tài)配置API的場(chǎng)景
  • 特殊的路由需求(如基于請(qǐng)求頭或Cookie的路由)

四、請(qǐng)求映射注解高級(jí)配置

4.1 基本原理

Spring MVC的@RequestMapping及其衍生注解(@GetMapping、@PostMapping等)提供了豐富的配置選項(xiàng),可以基于HTTP方法、請(qǐng)求頭、內(nèi)容類型、參數(shù)等條件進(jìn)行精細(xì)的請(qǐng)求匹配。

4.2 實(shí)現(xiàn)方式

1. 基于請(qǐng)求頭映射:

@RestController
public class ApiVersionController {
    
    @GetMapping(value = "/api/users", headers = "API-Version=1")
    public List<UserV1DTO> getUsersV1() {
        return userService.findAllV1();
    }
    
    @GetMapping(value = "/api/users", headers = "API-Version=2")
    public List<UserV2DTO> getUsersV2() {
        return userService.findAllV2();
    }
}

2. 基于Content-Type映射(消費(fèi)類型):

@RestController
@RequestMapping("/api/users")
public class UserController {
    
    @PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE)
    public User createUserFromJson(@RequestBody User user) {
        return userService.create(user);
    }
    
    @PostMapping(consumes = MediaType.APPLICATION_XML_VALUE)
    public User createUserFromXml(@RequestBody User user) {
        return userService.create(user);
    }
    
    @PostMapping(consumes = "application/x-www-form-urlencoded")
    public User createUserFromForm(UserForm form) {
        User user = new User();
        BeanUtils.copyProperties(form, user);
        return userService.create(user);
    }
}

3. 基于Accept映射(生產(chǎn)類型):

@RestController
@RequestMapping("/api/users")
public class UserController {
    
    @GetMapping(value = "/{id}", produces = MediaType.APPLICATION_JSON_VALUE)
    public User getUserAsJson(@PathVariable Long id) {
        return userService.findById(id);
    }
    
    @GetMapping(value = "/{id}", produces = MediaType.APPLICATION_XML_VALUE)
    public UserXmlWrapper getUserAsXml(@PathVariable Long id) {
        User user = userService.findById(id);
        return new UserXmlWrapper(user);
    }
    
    @GetMapping(value = "/{id}", produces = "text/csv")
    public String getUserAsCsv(@PathVariable Long id) {
        User user = userService.findById(id);
        return convertToCsv(user);
    }
}

4. 請(qǐng)求參數(shù)條件映射:

@RestController
@RequestMapping("/api/products")
public class ProductController {
    
    @GetMapping(params = "category")
    public List<Product> getProductsByCategory(@RequestParam String category) {
        return productService.findByCategory(category);
    }
    
    @GetMapping(params = {"minPrice", "maxPrice"})
    public List<Product> getProductsByPriceRange(
            @RequestParam Double minPrice,
            @RequestParam Double maxPrice) {
        return productService.findByPriceRange(minPrice, maxPrice);
    }
    
    @GetMapping(params = "search")
    public List<Product> searchProducts(@RequestParam String search) {
        return productService.search(search);
    }
    
    @GetMapping  // 無(wú)參數(shù)時(shí)的默認(rèn)處理
    public List<Product> getAllProducts() {
        return productService.findAll();
    }
}

5. 組合條件映射:

@RestController
public class ComplexMappingController {
    
    @RequestMapping(
        value = "/api/documents/{id}",
        method = RequestMethod.GET,
        headers = {"Authorization", "Content-Type=application/json"},
        produces = MediaType.APPLICATION_JSON_VALUE,
        params = "version"
    )
    public Document getDocument(
            @PathVariable Long id,
            @RequestParam String version,
            @RequestHeader("Authorization") String auth) {
        // 處理請(qǐng)求
        return documentService.findByIdAndVersion(id, version);
    }
}

4.3 優(yōu)缺點(diǎn)與適用場(chǎng)景

優(yōu)點(diǎn):

  • 提供細(xì)粒度的請(qǐng)求匹配控制
  • 支持內(nèi)容協(xié)商(Content Negotiation)
  • 可以實(shí)現(xiàn)同一URL針對(duì)不同客戶端的多種響應(yīng)形式

缺點(diǎn):

  • 復(fù)雜配置可能降低代碼可讀性
  • 過(guò)多的映射條件可能導(dǎo)致維護(hù)困難
  • 可能引起請(qǐng)求匹配沖突

適用場(chǎng)景:

  • 需要提供多種格式響應(yīng)的API
  • API版本控制
  • 需要基于請(qǐng)求特征進(jìn)行差異化處理的場(chǎng)景

五、URI正規(guī)化與路徑匹配優(yōu)化

5.1 基本原理

URI正規(guī)化是指將輸入的URI轉(zhuǎn)換為標(biāo)準(zhǔn)形式,以便更準(zhǔn)確地進(jìn)行路徑匹配。Spring MVC提供了多種路徑匹配策略,可以根據(jù)應(yīng)用需求進(jìn)行優(yōu)化,提高請(qǐng)求路由的效率和準(zhǔn)確性。

5.2 實(shí)現(xiàn)方式

1. 配置路徑匹配策略:

@Configuration
public class WebConfig implements WebMvcConfigurer {
    
    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
        UrlPathHelper urlPathHelper = new UrlPathHelper();
        // 是否移除分號(hào)內(nèi)容(矩陣變量)
        urlPathHelper.setRemoveSemicolonContent(false);
        // 是否URL解碼
        urlPathHelper.setUrlDecode(true);
        // 設(shè)置默認(rèn)編碼
        urlPathHelper.setDefaultEncoding("UTF-8");
        configurer.setUrlPathHelper(urlPathHelper);
        
        // 路徑后綴匹配
        configurer.setUseSuffixPatternMatch(false);
        // 添加尾部斜杠匹配
        configurer.setUseTrailingSlashMatch(true);
    }
}

2. 自定義路徑匹配器:

@Configuration
public class CustomPathMatchConfig implements WebMvcConfigurer {
    
    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
        configurer.setPathMatcher(new CustomAntPathMatcher());
    }
}

public class CustomAntPathMatcher extends AntPathMatcher {
    
    @Override
    public boolean match(String pattern, String path) {
        // 添加自定義匹配邏輯
        if (pattern.startsWith("/api/v{version}")) {
            // 特殊處理版本路徑
            return matchVersion(pattern, path);
        }
        return super.match(pattern, path);
    }
    
    private boolean matchVersion(String pattern, String path) {
        // 自定義版本匹配邏輯
        // ...
        return true;
    }
}

3. 路徑規(guī)范化處理:

@ControllerAdvice
public class UriNormalizationAdvice {
    
    @Autowired
    private ServletContext servletContext;
    
    @ModelAttribute
    public void normalizeUri(HttpServletRequest request, HttpServletResponse response) {
        String requestUri = request.getRequestURI();
        String normalizedUri = normalizeUri(requestUri);
        
        if (!requestUri.equals(normalizedUri)) {
            String queryString = request.getQueryString();
            String redirectUrl = normalizedUri + (queryString != null ? "?" + queryString : "");
            response.setStatus(HttpStatus.MOVED_PERMANENTLY.value());
            response.setHeader("Location", redirectUrl);
        }
    }
    
    private String normalizeUri(String uri) {
        // 移除多余的斜杠
        String normalized = uri.replaceAll("/+", "/");
        
        // 確保非根路徑不以斜杠結(jié)尾
        if (normalized.length() > 1 && normalized.endsWith("/")) {
            normalized = normalized.substring(0, normalized.length() - 1);
        }
        
        return normalized;
    }
}

4. 自定義URI規(guī)范化過(guò)濾器:

@Component
public class UriNormalizationFilter extends OncePerRequestFilter {
    
    @Override
    protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, 
                                   FilterChain filterChain) throws ServletException, IOException {
        String requestUri = request.getRequestURI();
        
        // 1. 處理大小寫(轉(zhuǎn)為小寫)
        String normalizedUri = requestUri.toLowerCase();
        
        // 2. 規(guī)范化路徑段
        normalizedUri = normalizePath(normalizedUri);
        
        // 3. 如果URI已更改,則重定向
        if (!requestUri.equals(normalizedUri)) {
            String queryString = request.getQueryString();
            String redirectUrl = normalizedUri + (queryString != null ? "?" + queryString : "");
            response.sendRedirect(redirectUrl);
            return;
        }
        
        filterChain.doFilter(request, response);
    }
    
    private String normalizePath(String path) {
        // 規(guī)范化路徑的具體邏輯
        // ...
        return path;
    }
}

5.3 優(yōu)缺點(diǎn)與適用場(chǎng)景

優(yōu)點(diǎn):

  • 提高URL匹配的準(zhǔn)確性和一致性
  • 改善SEO,避免重復(fù)內(nèi)容
  • 提升路由性能
  • 簡(jiǎn)化API維護(hù)

缺點(diǎn):

  • 配置過(guò)于復(fù)雜可能難以理解
  • 不當(dāng)配置可能導(dǎo)致路由錯(cuò)誤
  • 可能引入額外的請(qǐng)求處理開(kāi)銷

適用場(chǎng)景:

  • 具有復(fù)雜路由規(guī)則的大型應(yīng)用
  • 對(duì)URL格式有嚴(yán)格要求的場(chǎng)景
  • SEO敏感的公開(kāi)網(wǎng)站
  • 需要支持特殊URL格式的應(yīng)用

以上就是SpringBoot請(qǐng)求映射的五種優(yōu)化方式小結(jié)的詳細(xì)內(nèi)容,更多關(guān)于SpringBoot請(qǐng)求映射優(yōu)化的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

  • 利用MyBatis-Plus靈活處理JSON字段的技巧與最佳實(shí)踐

    利用MyBatis-Plus靈活處理JSON字段的技巧與最佳實(shí)踐

    這篇文章主要給大家介紹了關(guān)于利用MyBatis-Plus靈活處理JSON字段的技巧與最佳實(shí)踐,Mybatis-Plus可以很方便地處理JSON字段,在實(shí)體類中可以使用@JSONField注解來(lái)標(biāo)記JSON字段,需要的朋友可以參考下
    2024-07-07
  • java 獲取當(dāng)前函數(shù)名的實(shí)現(xiàn)代碼

    java 獲取當(dāng)前函數(shù)名的實(shí)現(xiàn)代碼

    以下是對(duì)使用java獲取當(dāng)前函數(shù)名的實(shí)現(xiàn)代碼進(jìn)行了介紹。需要的朋友可以過(guò)來(lái)參考下
    2013-08-08
  • springboot Jackson全局配置過(guò)程

    springboot Jackson全局配置過(guò)程

    SpringBoot Jackson 全局配置詳解,介紹如何針對(duì)單個(gè)對(duì)象屬性、配置文件及自定義 ObjectMapper 進(jìn)行序列化規(guī)則的配置
    2026-05-05
  • Spring File Storage文件的對(duì)象存儲(chǔ)框架基本使用小結(jié)

    Spring File Storage文件的對(duì)象存儲(chǔ)框架基本使用小結(jié)

    在開(kāi)發(fā)過(guò)程當(dāng)中,會(huì)使用到存文檔、圖片、視頻、音頻等等,這些都會(huì)涉及存儲(chǔ)的問(wèn)題,文件可以直接存服務(wù)器,但需要考慮帶寬和存儲(chǔ)空間,另外一種方式就是使用云存儲(chǔ),這篇文章主要介紹了Spring File Storage文件的對(duì)象存儲(chǔ)框架基本使用小結(jié),需要的朋友可以參考下
    2024-08-08
  • 淺談springioc實(shí)例化bean的三個(gè)方法

    淺談springioc實(shí)例化bean的三個(gè)方法

    下面小編就為大家?guī)?lái)一篇淺談springioc實(shí)例化bean的三個(gè)方法。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就想給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2017-09-09
  • Java中字符串與日期轉(zhuǎn)換常見(jiàn)方法總結(jié)

    Java中字符串與日期轉(zhuǎn)換常見(jiàn)方法總結(jié)

    這篇文章主要給大家介紹了關(guān)于Java中字符串與日期轉(zhuǎn)換常見(jiàn)方法的相關(guān)資料,在Java編程中經(jīng)常需要將字符串表示的日期轉(zhuǎn)換為日期對(duì)象進(jìn)行處理,文中通過(guò)代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2023-11-11
  • Mybatis原始執(zhí)行方式Executor代碼實(shí)例

    Mybatis原始執(zhí)行方式Executor代碼實(shí)例

    這篇文章主要介紹了Mybatis原始執(zhí)行方式Executor代碼實(shí)例解析,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-07-07
  • Java:com.netflix.client.ClientException錯(cuò)誤解決

    Java:com.netflix.client.ClientException錯(cuò)誤解決

    本文主要介紹了Java:com.netflix.client.ClientException錯(cuò)誤解決,主要是指出客戶端?module-sso?試圖通過(guò)負(fù)載均衡器訪問(wèn)服務(wù)時(shí),負(fù)載均衡器沒(méi)有找到可用的服務(wù)器來(lái)處理請(qǐng)求,下面就來(lái)介紹一下解決方法
    2024-08-08
  • EasyExcel工具讀取Excel空數(shù)據(jù)行問(wèn)題的解決辦法

    EasyExcel工具讀取Excel空數(shù)據(jù)行問(wèn)題的解決辦法

    EasyExcel是阿里巴巴開(kāi)源的一個(gè)excel處理框架,以使用簡(jiǎn)單,節(jié)省內(nèi)存著稱,下面這篇文章主要給大家介紹了關(guān)于EasyExcel工具讀取Excel空數(shù)據(jù)行問(wèn)題的解決辦法,需要的朋友可以參考下
    2022-08-08
  • JsonObject的屬性與值的判空(Null值)處理方式

    JsonObject的屬性與值的判空(Null值)處理方式

    這篇文章主要介紹了JsonObject的屬性與值的判空(Null值)處理方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-12-12

最新評(píng)論

万州区| 安丘市| 中超| 汶上县| 嘉鱼县| 衡阳县| 文山县| 松滋市| 德保县| 闽清县| 宝应县| 澳门| 宁明县| 津市市| 鸡西市| 华蓥市| 萍乡市| 马边| 邓州市| 疏勒县| 威海市| 浙江省| 永年县| 高淳县| 安庆市| 临朐县| 友谊县| 波密县| 清水县| 伽师县| 郑州市| 丹巴县| 玉环县| 沁源县| 乳源| 九龙城区| 南木林县| 化德县| 汾阳市| 乌什县| 台山市|