Tabnine Logo
Response$Content.withMimeType
Code IndexAdd Tabnine to your IDE (free)

How to use
withMimeType
method
in
juzu.Response$Content

Best Java code snippets using juzu.Response$Content.withMimeType (Showing top 5 results out of 315)

origin: org.juzu/juzu-core

public Status asStatus(boolean verbose) {
 Response.Status response = Response.status(getStatus());
 if (verbose) {
  StringBuilder buffer = new StringBuilder();
  Formatting.renderStyleSheet(buffer);
  buffer.append("<div class=\"juzu\">");
  buffer.append("<h1>Oups something went wrong</h1>");
  // Use getCause as it can be overriden with subclasses
  Throwable c = getCause();
  if (c != null) {
   Formatting.renderThrowable(null, buffer, c);
  } else {
   // Use getMessage as it can be overriden with subclasses
   String m = getHtmlMessage();
   buffer.append(m);
  }
  buffer.append("</div>");
  response = response.content(buffer).withMimeType("text/html");
 }
 return response;
}
origin: juzu/juzu

public Status asStatus(boolean verbose) {
 Response.Status response = Response.status(getStatus());
 if (verbose) {
  StringBuilder buffer = new StringBuilder();
  Formatting.renderStyleSheet(buffer);
  buffer.append("<div class=\"juzu\">");
  buffer.append("<h1>Oups something went wrong</h1>");
  // Use getCause as it can be overriden with subclasses
  Throwable c = getCause();
  if (c != null) {
   Formatting.renderThrowable(null, buffer, c);
  } else {
   // Use getMessage as it can be overriden with subclasses
   String m = getHtmlMessage();
   buffer.append(m);
  }
  buffer.append("</div>");
  response = response.content(buffer).withMimeType("text/html");
 }
 return response;
}
origin: exoplatform/platform

@Ajax
@Resource
public Response saveActivePlugin(String pluginId, String inputs) {
 JSON data = new JSON();
 try {
  Map<String, String> datas = parserParams(inputs);
  for (String channelId : datas.keySet()) {
   pluginSettingService.saveActivePlugin(channelId, pluginId, Boolean.valueOf(datas.get(channelId)));
  }
  data.set("status", "ok");
  data.set("result", datas);
 } catch (Exception e) {
  LOG.error("Failed to save settings", e);
  data.set("status", "false");
  data.set("error", "Exception: " + e.getMessage());
 }
 return Response.ok(data.toString()).withMimeType("application/json");
}

origin: exoplatform/platform

@Ajax
@Resource
public Response saveSender(String name, String email) {
 JSON data = new JSON();
 data.set("name", name);
 data.set("email",email);
 if(name != null && name.length() > 0 && NotificationUtils.isValidEmailAddresses(email)) {
  settingService.set(org.exoplatform.commons.api.settings.data.Context.GLOBAL, Scope.GLOBAL,
            NotificationPluginUtils.NOTIFICATION_SENDER_NAME, SettingValue.create(name));
  settingService.set(org.exoplatform.commons.api.settings.data.Context.GLOBAL, Scope.GLOBAL,
            NotificationPluginUtils.NOTIFICATION_SENDER_EMAIL, SettingValue.create(email));
  data.set("status","OK");
 } else {
  data.set("status","NOK");
 }
 return Response.ok(data.toString()).withMimeType("application/json");
}
origin: exoplatform/platform

@Resource
public Response.Content onlineFriends() {
  String userId = ConversationState.getCurrent().getIdentity().getUserId();
  JSONArray json = getOnlineFriends(userId);
  return Response.ok(json.toString()).withMimeType("application/json; charset=UTF-8").withHeader("Cache-Control", "no-cache");
}
juzuResponse$ContentwithMimeType

Popular methods of Response$Content

  • with
  • <init>
  • withCharset
  • withHeader
  • withHeaderTag
    Set the provided element on the response as an HTML header.

Popular in Java

  • Reading from database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • JFileChooser (javax.swing)
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now