List of usage examples for org.springframework.http MediaType TEXT_HTML_VALUE
String TEXT_HTML_VALUE
To view the source code for org.springframework.http MediaType TEXT_HTML_VALUE.
Click Source Link
From source file:com.hp.autonomy.frontend.find.core.view.ViewController.java
@RequestMapping(value = VIEW_STATIC_CONTENT_PROMOTION_PATH, method = RequestMethod.GET) public void viewStaticContentPromotion(@RequestParam(REFERENCE_PARAM) final String reference, final HttpServletResponse response) throws IOException, E { response.setContentType(MediaType.TEXT_HTML_VALUE); ViewContentSecurityPolicy.addContentSecurityPolicy(response); viewServerService.viewStaticContentPromotion(reference, response.getOutputStream()); }
From source file:org.cloudfoundry.identity.uaa.error.JsonAwareAccessDeniedHandlerTests.java
@Test public void testCommenceWithHtmlAndJsonAccept() throws Exception { request.addHeader("Accept", String.format("%s,%s", MediaType.TEXT_HTML_VALUE, MediaType.APPLICATION_JSON)); entryPoint.handle(request, response, new AccessDeniedException("Bad")); assertEquals(HttpServletResponse.SC_FORBIDDEN, response.getStatus()); assertEquals(null, response.getErrorMessage()); }
From source file:org.jutge.joc.porra.controller.desktop.DesktopAccountController.java
@EntityStashManaged @RequestMapping(value = "/entrar", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE) public String login(final HttpSession session, final HttpServletRequest request) { this.logger.info("DesktopAccountController.login"); this.validateLoginParams(session, request); return "/desktop/account/login"; }
From source file:org.jutge.joc.porra.controller.mobile.MobileAccountController.java
@RequestMapping(value = "/entrar", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE) public String login(final HttpSession session, final HttpServletRequest request) { this.logger.info("MobileAccountController.login"); this.validateLoginParams(session, request); return "/mobile/account/login"; }
From source file:org.jutge.joc.porra.controller.desktop.DesktopHomeController.java
@EntityStashManaged(entities = EntityStashEntityModule.ALL, views = { EntityStashViewModule.LEAGUE_INFO, EntityStashViewModule.LEAGUE_STATS, EntityStashViewModule.LEAGUE_POPULAR_PLAYERS, EntityStashViewModule.RICHEST_ACCOUNTS, EntityStashViewModule.ACCOUNT_INFO }) @RequestMapping(value = "/", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE) public String home() { this.logger.info("DesktopHomeController.home"); return "/desktop/home"; }
From source file:de.otto.mongodb.profiler.web.DatabaseController.java
@Page(mainNavigation = MainNavigation.DATABASES) @RequestMapping(value = "/{name:.+}", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE) public ModelAndView showDatabase(@PathVariable("connectionId") String connectionId, @PathVariable("name") String databaseName) throws ResourceNotFoundException { final ProfiledDatabase database = requireDatabase(connectionId, databaseName); final DatabasePageViewModel viewModel = new DatabasePageViewModel(database); return new ModelAndView("page.database").addObject("model", viewModel).addObject("collection", new AddCollectionProfileFormModel()); }
From source file:org.awesomeagile.testing.hackpad.FakeHackpadController.java
@RequestMapping(value = { "/api/1.0/pad/{padId}/content/latest.html" }, method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE) @ResponseBody/*w ww .j a v a2s . com*/ public String getHackpad(@PathVariable("padId") String padId, @RequestParam("oauth_consumer_key") String key) { if (!clientId.equals(key)) { throw new BadCredentialsException("Invalid client ID: " + key); } return hackpads.get(new PadIdentity(padId)); }
From source file:org.cloudfoundry.identity.uaa.error.JsonAwareAuthenticationEntryPointTests.java
@Test public void testCommenceWithHtmlAccept() throws Exception { request.addHeader("Accept", MediaType.TEXT_HTML_VALUE); entryPoint.commence(request, response, new BadCredentialsException("Bad")); assertEquals(HttpServletResponse.SC_UNAUTHORIZED, response.getStatus()); assertEquals("Bad", response.getErrorMessage()); }
From source file:de.otto.mongodb.profiler.web.CollectionProfileController.java
@RequestMapping(method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE) public View showCollectionProfiles(@PathVariable("connectionId") final String connectionId, @PathVariable("databaseName") final String databaseName, final UriComponentsBuilder uriComponentsBuilder) throws ResourceNotFoundException { final String uri = uriComponentsBuilder.path("/connections/{connectionId}/databases/{databaseName}") .fragment("Collections").buildAndExpand(connectionId, databaseName).toUriString(); return new RedirectView(uri); }
From source file:controller.SeatController.java
@RequestMapping(value = "/list/id/{id}", method = RequestMethod.PUT, produces = MediaType.TEXT_HTML_VALUE, consumes = MediaType.TEXT_HTML_VALUE) public @ResponseBody String loadSeats(@PathVariable Integer id) { String response = ""; try {//from w ww . ja va2 s.c o m id_play = id; seats = userService.findByShowID(id_play); response = utils.convertSeatsToHtml(seats); } catch (AppException e) { response = "Exception:" + e.getMessage(); } return response; }