spring-boot

    6熱度

    3回答

    我一直在爭取一段時間,找不到解決方案。我正在運行SpringBoot指南,並且使用REST訪問JPA數據(http://spring.io/guides/gs/accessing-data-rest/)不起作用。 只要下載並運行它運行良好,允許GET調用 http://localhost:8080/people 使用郵差。然而,每當我嘗試PUT或POST我收到以下錯誤 { "cause":

    3熱度

    1回答

    我在服務層的方法中添加了@Transactional。 @Transactional(readOnly = false) public void add(UserFollow uf){ UserFollow db_uf = userFollowRepository.findByUserIdAndFollowUserId(uf.getUserId(), uf.getFollowUserI

    0熱度

    1回答

    在我的春節,啓動Web服務應用程序,我想加載一個名爲APPNAME在application.properties定義的值屬性。 @Endpoint public class RasEndpoint { private static final String NAMESPACE_URI = "http://www.mycompany.com/schema/ras/ras-request/V1"

    4熱度

    2回答

    如果我使用@InitBinder而沒有限制它,它使用@RequestBody正常工作來驗證我的對象。 @InitBinder private void initBinder(WebDataBinder binder) { binder.setValidator(validator); } @RequestMapping(method=RequestMethod.POST)

    0熱度

    1回答

    將彈簧啓動從0.5.0.M7升級到1.1.9.RELEASE後出現奇怪問題。 我application.properties有定義 server.session-timeout=60 此屬性,但現在我會得到不活動1分鐘之內到期。我切換回以前的版本,問題消失。 我調試了我的代碼,看看ServerProperties.java是否在其中設置了60到sessionTimeout變量。它的確如此。 有

    9熱度

    2回答

    我有以下實體: package com.server.models; @Entity @Table(name="users") @NamedQueries({ @NamedQuery(name=User.QUERY_FIND_USER,query="SELECT c FROM user c WHERE c.username = :username") }) public cla

    0熱度

    1回答

    我gradle.build腳本是這樣的: buildscript { repositories { mavenCentral() maven { url 'https://repo.spring.io/simple/ext-release-local' } } dependencies { classpath("org.sprin

    9熱度

    1回答

    我想配置我的Spring Boot應用程序以在特定的環境變量存在時使用特定的數據源。例如,如果存在MY_PROD_DATASOURCE環境變量,我想使用我的生產數據源;否則,我想使用我的本地數據源(相同類型)。 我發現了something in the Spring reference,它解釋瞭如何在我的application.properties中聲明單個數據源。具體來說,一個MySQL數據源可

    0熱度

    1回答

    我已經看過谷歌文檔中的Oauth2工作流程,它看起來非常直觀。使用基本的servlet我知道如何處理所有的回調,但使用Spring Boot我有點困惑,如果我使用oauth和Spring安全模塊,我需要做的事情。 我發現一篇教程here描述如何使用用戶名和密碼添加認證,但我不確定這是否是我的需求的最佳選擇,因爲我主要想限制頁面中的內容而不是頁面本身。無論如何,假設我需要每頁身份驗證,我如何設置使用

    5熱度

    4回答

    我有一個在IntelliJ或通過gradle bootRun啓動時可以完美工作的應用程序。 但是,如果我做gradle這個bootRepackage,然後嘗試並運行結果罐子,我結束了: 2014-12-02 21:46:14.086 ERROR 9839 --- [nio-2014-exec-2] org.thymeleaf.TemplateEngine : [THYMELEAF][http