Example usage for javax.servlet ServletException printStackTrace

List of usage examples for javax.servlet ServletException printStackTrace

Introduction

In this page you can find the example usage for javax.servlet ServletException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:com.bluexml.xforms.controller.alfresco.AlfrescoController.java

public boolean authenticate(String username, String password) { // PUBLIC-API
    AlfrescoTransaction transaction = new AlfrescoTransaction(this, username);
    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put("username", username);
    parameters.put("password", password);
    transaction.setLogin(username);// www .  j a v a 2 s.  c o m
    String result;
    try {
        result = requestString(transaction, parameters, MsgId.INT_WEBSCRIPT_OPCODE_AUTHENTICATE);
    } catch (ServletException e) {
        e.printStackTrace();
        return false;
    }
    return StringUtils.equalsIgnoreCase(result, "success");
}

From source file:com.bluexml.xforms.controller.alfresco.AlfrescoController.java

public String getNodeContentInfo(AlfrescoTransaction transaction, String nodeId) {
    if (StringUtils.trimToNull(nodeId) == null) {
        return "";
    }/* www .  ja  va  2 s. com*/
    String request;
    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put("nodeId", nodeId);

    try {
        request = requestString(transaction, parameters, MsgId.INT_WEBSCRIPT_OPCODE_NODE_INFO);
    } catch (ServletException e) {
        e.printStackTrace();
        return null;
    }

    if (StringUtils.trimToNull(request) == null) {
        return "";
    }

    String result;
    String[] infos = request.split(","); // <- see the webscript for the actual format
    String nodeName = infos[0]; // the node name
    long size = Long.parseLong(infos[1]); // the content's size
    if (size > 0) {
        String sizeUnit = "";
        Formatter formatter = new Formatter();
        String sizeBytes = formatter.format("%,d", size).toString();
        char multiplier = getFileSizeUnit(size);
        if (multiplier != 'b') {
            sizeUnit = " (" + getFileSizeShortReadable(size, multiplier) + ")";
        } else {
            //
        }
        result = MsgPool.getMsg(MsgId.MSG_UPLOAD_CONTENT_REPO_FORMAT, nodeName, sizeBytes, sizeUnit, nodeId);
    } else {
        result = MsgPool.getMsg(MsgId.MSG_UPLOAD_CONTENT_NO_CONTENT);
    }
    // result += " " + result;
    return result;
}

From source file:com.portfolio.data.provider.MysqlAdminProvider.java

@Override
public void getCredential(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    try {/*from w ww. j  a va 2  s. co  m*/
        credential.doGet(request, response);
    } catch (ServletException e) {
        e.printStackTrace();
    }
}

From source file:com.portfolio.data.provider.MysqlAdminProvider.java

@Override
public String[] postCredential(String login, String password, Integer UserId)
        throws ServletException, IOException {
    try {/*w ww.  j  a  v a  2  s  .co m*/
        return credential.doPost(login, password);
    } catch (ServletException e) {
        e.printStackTrace();
        return null;
    }
}

From source file:com.portfolio.data.provider.MysqlAdminProvider.java

@Override
public String getUserUidByTokenAndLogin(String login, String token) throws Exception {
    try {/* w w w .ja  va 2  s.c o  m*/
        return credential.getMysqlUserUidByTokenAndLogin(login, token);
    } catch (ServletException e) {
        e.printStackTrace();
        return null;
    }

}

From source file:com.portfolio.data.provider.MysqlDataProvider.java

@Override
public String getUserUidByTokenAndLogin(String login, String token) throws Exception {
    try {/* w  ww .j  a v  a2  s . c  o  m*/
        return credential.getMysqlUserUidByTokenAndLogin(login, token);
    } catch (ServletException e) {
        e.printStackTrace();
        return null;
    }
}