第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Spring MVC 休息控制器未調(diào)用

Spring MVC 休息控制器未調(diào)用

臨摹微笑 2023-11-10 15:40:33
我正在開發(fā)一個(gè)彈簧支架控制器。但是,當(dāng)我嘗試訪問 url ( http://localhost:8080/customer-crm/api/customer ) 時(shí),它不起作用并給出 404 not find 。但對(duì)于根“/”,它工作正常并給出index.jsp頁(yè)面這是AppConfiguration.class:package com.customer.crm.configuration;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.ComponentScan;import org.springframework.context.annotation.Configuration;import org.springframework.web.servlet.ViewResolver;import org.springframework.web.servlet.config.annotation.EnableWebMvc;import org.springframework.web.servlet.view.InternalResourceViewResolver;import org.springframework.web.servlet.view.JstlView;@Configuration@EnableWebMvc@ComponentScan(basePackages = "com.customer.crm")public class AppConfiguration {    @Bean    public ViewResolver viewResolver() {        InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();        viewResolver.setViewClass(JstlView.class);        viewResolver.setPrefix("/WEB-INF/views/");        viewResolver.setSuffix(".jsp");        return viewResolver;    }}這是Index.class控制器:package com.customer.crm.rest;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RequestMethod;import org.springframework.web.bind.annotation.RestController;import com.customer.crm.entity.Customer;@RestController@RequestMapping("/api")public class Index {    @RequestMapping(value = "/customer", method = RequestMethod.GET)    public Customer getIndex() {        System.out.println("executing in index controller");        Customer customer = new Customer("Mike", "John", "mike.john@gmail.com");        return customer;    }甚至連消息也getIndex()沒有打印出來。我嘗試清理項(xiàng)目并清理 tomcat 目錄,但沒有任何改變。誰(shuí)能告訴我問題出在哪里?
查看完整描述

1 回答

?
千萬(wàn)里不及你

TA貢獻(xiàn)1784條經(jīng)驗(yàn) 獲得超9個(gè)贊

哦伙計(jì)們,我解決了。這是該文件的拼寫錯(cuò)誤application.properties。它被命名為“application.properities”。抱歉占用您的時(shí)間,謝謝!



查看完整回答
反對(duì) 回復(fù) 2023-11-10
  • 1 回答
  • 0 關(guān)注
  • 129 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)