当前位置: 首页>>代码示例>>Java>>正文


Java ParamUtils.getLongParameter方法代码示例

本文整理汇总了Java中org.jivesoftware.util.ParamUtils.getLongParameter方法的典型用法代码示例。如果您正苦于以下问题:Java ParamUtils.getLongParameter方法的具体用法?Java ParamUtils.getLongParameter怎么用?Java ParamUtils.getLongParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jivesoftware.util.ParamUtils的用法示例。


在下文中一共展示了ParamUtils.getLongParameter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doGet

import org.jivesoftware.util.ParamUtils; //导入方法依赖的package包/类
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    long conversationID = ParamUtils.getLongParameter(request, "conversationID", -1);
    if (conversationID == -1) {
        return;
    }

    MonitoringPlugin plugin = (MonitoringPlugin)XMPPServer.getInstance().getPluginManager().getPlugin(
            MonitoringConstants.NAME);
    ConversationManager conversationManager = (ConversationManager)plugin.getModule(ConversationManager.class);
    Conversation conversation;
    if (conversationID > -1) {
        try {
            conversation = new Conversation(conversationManager, conversationID);

            ByteArrayOutputStream stream = new ConversationUtils().getConversationPDF(conversation);

            // setting some response headers
            response.setHeader("Expires", "0");
            response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
            response.setHeader("Pragma", "public");
            // setting the content type
            response.setContentType("application/pdf");
            // the content length is needed for MSIE!!!
            response.setContentLength(stream.size());
            // write ByteArrayOutputStream to the ServletOutputStream
            ServletOutputStream out = response.getOutputStream();
            stream.writeTo(out);
            out.flush();
        }
        catch (NotFoundException nfe) {
            Log.error(nfe.getMessage(), nfe);
        }
    }

}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:37,代码来源:ConversationPDFServlet.java

示例2: doGet

import org.jivesoftware.util.ParamUtils; //导入方法依赖的package包/类
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       long conversationID = ParamUtils.getLongParameter(request, "conversationID", -1);
       if (conversationID == -1) {
           return;
       }

       MonitoringPlugin plugin = (MonitoringPlugin)XMPPServer.getInstance().getPluginManager().getPlugin(
           "monitoring");
       ConversationManager conversationManager = (ConversationManager)plugin.getModule(ConversationManager.class);
       Conversation conversation;
       if (conversationID > -1) {
           try {
               conversation = new Conversation(conversationManager, conversationID);

               ByteArrayOutputStream stream = new ConversationUtils().getConversationPDF(conversation);

               // setting some response headers
               response.setHeader("Expires", "0");
               response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
               response.setHeader("Pragma", "public");
               // setting the content type
               response.setContentType("application/pdf");
               // the content length is needed for MSIE!!!
               response.setContentLength(stream.size());
               // write ByteArrayOutputStream to the ServletOutputStream
               ServletOutputStream out = response.getOutputStream();
               stream.writeTo(out);
               out.flush();
           }
           catch (NotFoundException nfe) {
               Log.error(nfe.getMessage(), nfe);
           }
       }

   }
 
开发者ID:coodeer,项目名称:g3server,代码行数:37,代码来源:ConversationPDFServlet.java

示例3: doGet

import org.jivesoftware.util.ParamUtils; //导入方法依赖的package包/类
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       long conversationID = ParamUtils.getLongParameter(request, "conversationID", -1);
       if (conversationID == -1) {
           return;
       }

       MonitoringPlugin plugin = (MonitoringPlugin)XMPPServer.getInstance().getPluginManager().getPlugin(
       		MonitoringConstants.NAME);
       ConversationManager conversationManager = (ConversationManager)plugin.getModule(ConversationManager.class);
       Conversation conversation;
       if (conversationID > -1) {
           try {
               conversation = new Conversation(conversationManager, conversationID);

               ByteArrayOutputStream stream = new ConversationUtils().getConversationPDF(conversation);

               // setting some response headers
               response.setHeader("Expires", "0");
               response.setHeader("Cache-Control", "must-revalidate, post-check=0, pre-check=0");
               response.setHeader("Pragma", "public");
               // setting the content type
               response.setContentType("application/pdf");
               // the content length is needed for MSIE!!!
               response.setContentLength(stream.size());
               // write ByteArrayOutputStream to the ServletOutputStream
               ServletOutputStream out = response.getOutputStream();
               stream.writeTo(out);
               out.flush();
           }
           catch (NotFoundException nfe) {
               Log.error(nfe.getMessage(), nfe);
           }
       }

   }
 
开发者ID:idwanglu2010,项目名称:openfire,代码行数:37,代码来源:ConversationPDFServlet.java


注:本文中的org.jivesoftware.util.ParamUtils.getLongParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。