Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
easonjim committed Oct 11, 2017
1 parent e498cd7 commit 3f88065
Showing 1 changed file with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.jsoft.springboottest.springboottest1.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.ctrip.framework.apollo.Config;
import com.ctrip.framework.apollo.ConfigChangeListener;
import com.ctrip.framework.apollo.ConfigService;
import com.ctrip.framework.apollo.model.ConfigChange;
import com.ctrip.framework.apollo.model.ConfigChangeEvent;
import com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig;

@Controller
public class IndexController2 {

private static final Logger logger = LoggerFactory.getLogger(IndexController2.class);

private Config config = ConfigService.getAppConfig();

@RequestMapping(value = "/index2", method = RequestMethod.GET)
public String index(Model model) {
Entry entry = new Entry();
entry.setText("Text");
entry.setTitle("Title");
model.addAttribute("entries", entry);
model.addAttribute("entry", new Entry());

model.addAttribute("url", config.getProperty("url", ""));
model.addAttribute("timeout",config.getProperty("timeout", ""));
model.addAttribute("batch",config.getProperty("batch", ""));

logger.info("timeout:{}", config.getProperty("timeout", ""));
logger.info("batch:{}", config.getProperty("batch", ""));
logger.info("url:{}", config.getProperty("url", ""));

return "index";
}

}

0 comments on commit 3f88065

Please sign in to comment.