/*
* Copyright 2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id: HelloWorldExample.java,v 1.1.62.1 2006/01/18 20:00:48 abadea Exp $
*
*/
import com.bca.api.local.MClientApi;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ResourceBundle;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* The simplest possible servlet.
*
* @author James Duncan Davidson
*/
public class HelloWorldExample extends HttpServlet {
public final static com.bca.tools.log.Log log = com.bca.tools.log.LogFactory.getLog();
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
ResourceBundle rb =
ResourceBundle.getBundle("LocalStrings",request.getLocale());
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
String title = rb.getString("helloworld.title");
out.println("<title>" + title + "</title>");
out.println("</head>");
out.println("<body bgcolor=\"white\">");
// note that all links are created to be relative. this
// ensures that we can move the web application that this
// servlet belongs to to a different place in the url
// tree and not have any harmful side effects.
// XXX
// making these absolute till we work out the
// addition of a PathInfo issue
out.println("<a href=\"../helloworld.html\">");
out.println("<img src=\"../images/code.gif\" height=24 " +
"width=24 align=right border=0 alt=\"view code\"></a>");
out.println("<a href=\"../index.html\">");
out.println("<img src=\"../images/return.gif\" height=24 " +
"width=24 align=right border=0 alt=\"return\"></a>");
out.println("<h1>" + title + "</h1>");
out.println(loadMClientApi());
out.println("</body>");
out.println("</html>");
}
private String loadMClientApi() {
String password = "1";
String loginId = "100";
StringBuffer info = new StringBuffer();
MClientApi api = new MClientApi(getServletContext());
int handle = -1;
api.connectServer();
assert api.isReady();
handle = api.wmConnect(loginId, password, info);
log.debug("<%s> login handle: %d", loginId, handle);
api.wmDisconnect(handle);
return String.format("MClientApi handle is : %s. cn info : %s", handle, info.toString());
}
}
分享到:
相关推荐
3) 在浏览器中通过站点地址访问上传文件中的 update_版本号.php文件(http://你的网站域名/update_版本号.php)4) 安装完成后,会在站点后台生成手机客户端的设置后台,目录为:应用->手机客户端标准版
安装手机客户端api(和安装插件类似) 0)mclientapi/update.xml 设置成可写权限 (升级方可正常) 1)下载对应编码的服务端程序包(支持pw8.0~8.7版本)) 2)将解压后的... 3)在浏览器中通过站点地址访问上传文件中的 upd
一款基于机器学习的Web日志统计分析与异常检测命令行工具_hy4
基于RBAC权限控制的资产管理系统_hy5
318 Series Hardened Access Points 370 Series Outdoor Access Points 310 Series Campus Access Points IAP-315 IAP-314
最强PMP备考计划、知识整理、试题,并以本系统来展示_hy5
【官方】计算机职业英语一级考试样卷.pdf 【官方】全国机等级考试二级笔试样卷:存取(Access)数据库程序设计.pdf 【官方】全国计算机等级考试二级笔试样卷:C++语言程序设计.pdf 【官方】全国计算机等级考试二级笔试样卷:C语言程序设计.pdf 【官方】全国机等级考试二级笔试样卷:德尔菲(Delphi)语言程序设计.pdf 【官方】全国机等级考试二级笔试样卷:Java语言程序设计.pdf 【官方】全国机等级考试二级笔试样卷:视觉基础语言程序设计.pdf 【官方】全国机等级考试二级笔试样卷:视讯FoxPro数据库程序设计.pdf 【官方】全国计算机等级考试三级笔试样卷:PC技术,pdf 【官方】全国计算机等级考试三级笔试样卷:网络技术.pdf 【官方】全国计算机等级考试三级笔试样卷:信息管理技术,pdf 【官方】全国计算机等级考试四级笔试样卷:软件测试工程师.pdf 【官方】全国计算机等级考试四级笔试样卷:数据库工程师,pdf 【官方】全国计算机等级考试四级笔试样卷:数据库技术,pdf 【官方】全国计算机等级考试四级笔试样卷:网络工程师.pdf
SpringBoot网上商城#java#毕业设计#网上商城#springboot#课程设计#编程#thymeleaf_hy4
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。
360 Series Outdoor Access Points 303 Series Campus Access Points 303H Series Hospitality Access Points 300 Series Campus Access Points
肽质量指纹图谱提取区域检测系统源码分享[一条龙教学YOLOV8标注好的数据集一键训练_70+全套改进创新点发刊_Web前端展示]
分布式事务实战_hy4
python网络爬虫按月爬cctv新闻30分的视频_hy4
【golang】企业微信群机器人接口Golang封装
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。
mumu-activemq是一个对老牌mq消息中间件的学习和测试项目,本人通过这个项目来熟悉activemq的消息发送流_hy4
【Python+HTML】基于flask的rbac学生权限管理系统,redis存储session_pgj
一步一步学springboot2:微服务项目实战(第二版)_hy5
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。