Example usage for org.springframework.http MediaType TEXT_HTML_VALUE

List of usage examples for org.springframework.http MediaType TEXT_HTML_VALUE

Introduction

In this page you can find the example usage for org.springframework.http MediaType TEXT_HTML_VALUE.

Prototype

String TEXT_HTML_VALUE

To view the source code for org.springframework.http MediaType TEXT_HTML_VALUE.

Click Source Link

Document

A String equivalent of MediaType#TEXT_HTML .

Usage

From source file:com.coffeebeans.services.controller.web.index.IndexController.java

@RequestMapping(value = { "", "index**",
        "welcome**" }, method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
public ModelAndView displayAPIVersion() throws Exception {
    Map<String, Object> model = new HashMap<>();
    model.put("apiversion", versionService.getVersion().getApiVersion());
    ModelAndView modelAndView = new ModelAndView("version", model);

    return modelAndView;
}

From source file:com.microservice.training.hal.HalBrowser.java

/**
 * Redirects requests to the API root asking for HTML to the HAL browser.
 * //from   w  ww.  j ava2  s.com
 * @return
 */
@RequestMapping(value = { "/", "" }, method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
public View index(HttpServletRequest request) {
    return getRedirectView(request, false);
}

From source file:com.capside.pokemondemo.PokemonCtrl.java

@RequestMapping(value = "/", method = RequestMethod.GET, produces = { MediaType.TEXT_HTML_VALUE })
String index(Map<String, Object> model) {
    String host = System.getenv("HOST") == null ? "dev" : System.getenv("HOST");
    model.put("host", host);
    model.put("pokemon", pokemon);

    Set<Map.Entry<String, String>> env = System.getenv().entrySet();
    model.put("env", env);
    model.put("task", System.getenv().get("MESOS_TASK_ID"));

    return "index";
}

From source file:com.digitgroup.fullstackroad.web.controller.EShopController.java

@RequestMapping(value = "/person", produces = { MediaType.TEXT_HTML_VALUE }, method = RequestMethod.GET)
public String person() {
    return "person";
}

From source file:at.porscheinformatik.common.spring.web.extended.template.cache.html.HtmlTemplateController.java

@RequestMapping(value = "**", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
@ResponseBody/* ww w.j  av a 2  s. c  om*/
public String handleIndex() {
    if (!indexAvaliable()) {
        throw new ResourceNotFoundException();
    }

    return renderDefaultTemplate(INDEX);
}

From source file:com.hp.autonomy.frontend.find.core.view.ViewController.java

@RequestMapping(value = VIEW_DOCUMENT_PATH, method = RequestMethod.GET)
public void viewDocument(@RequestParam(REFERENCE_PARAM) final String reference,
        @RequestParam(DATABASE_PARAM) final S database,
        @RequestParam(value = HIGHLIGHT_PARAM, required = false) final String highlightExpression,
        final HttpServletResponse response) throws E, IOException {
    response.setContentType(MediaType.TEXT_HTML_VALUE);
    ViewContentSecurityPolicy.addContentSecurityPolicy(response);
    viewServerService.viewDocument(reference, database, highlightExpression, response.getOutputStream());
}

From source file:de.otto.mongodb.profiler.web.DatabaseController.java

@RequestMapping(method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
public View showDatabases(@PathVariable("connectionId") final String connectionId,
        final UriComponentsBuilder uriComponentsBuilder) throws ResourceNotFoundException {

    final String uri = uriComponentsBuilder.path("/connections/{connectionId}").buildAndExpand(connectionId)
            .toUriString();/*from   ww  w .  j a va 2  s . c o  m*/

    return new RedirectView(uri);
}

From source file:de.otto.mongodb.profiler.web.ConnectionController.java

@Page(mainNavigation = MainNavigation.CONNECTIONS)
@RequestMapping(method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
public ModelAndView showConnections() {

    final ConnectionsPageViewModel viewModel = new ConnectionsPageViewModel(
            getProfilerService().getConnections());

    return new ModelAndView("page.connections").addObject("model", viewModel);
}

From source file:demo.web.UserVehicleController.java

@GetMapping(path = "/{username}/vehicle.html", produces = MediaType.TEXT_HTML_VALUE)
public String VehicleDetailsHtml(@PathVariable String username) {
    VehicleDetails details = this.userVehicleService.getVehicleDetails(username);
    String makeAndModel = details.getMake() + " " + details.getModel();
    return "<html><body><h1>" + makeAndModel + "</h1></body></html>";
}

From source file:istata.web.HtmlController.java

@RequestMapping(value = "results", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
@ResponseBody//  w w w  .j a  v  a  2s  .  c o m
public String results() {
    return stataService.results("");
}