首页 文章 精选 留言 我的

精选列表

搜索[Web 应用托管],共10000篇文章
优秀的个人博客,低调大师

前端jsp与后端servlet传值(java web)

jsp中js使用jQuery封装好的 $.ajax()方法与服务器进行交互 var jsonStick = this.strtoJson(); $.ajax({ type : 'post',//不起作用 要用jsonP url : 'controllerServlet',//要传输数据对象的地址 contentType : "application/x-www-form-urlencoded",//转化为form表单传值 data : { "js" : jsonStick }, //前面的js是服务端获取的ID 后面的jsonStick是处理后的json对象 cache : false, dataType : 'text',//这个关系到你能不能正确接收到servlet 响应的数据 async : false, //因为ajax默认是异步调用的,所以得到的返回值是空值,要得到值必须改成同步:async: false success : function(data) { //console.log(data); flag = data; //采用全局变量flag接收数据(data未作处理) }, error : function(msg) { //ajax请求失败后触发的方法 //弹出错误信息 console.log(msg); } }); //数据处理函数 function() { //'':this.note.name, var arr = []; var json = {}; json.note_id = this.id json.note = this.text; json.left = this.left; json.top = this.top; json.zindex = this.zIndex; if (this.sqlId == null) { this.sqlId = 0; } json.sqlId = this.sqlId; arr.push(json); var jsonStick = JSON.stringify(arr);//格式化json数据 return jsonStick; } servlet接收 处理 响应 protected void doGet(.........){ String js = request.getParameter("js");//接收jsp传过来的数据 JSONArray json = JSONArray.fromObject(js);//对数据进行数组转化 JSONObject jsonOne = json.getJSONObject(0);//获取确定的json对象 boolean flag = true; PrintWriter out = response.getWriter(); out.print(flag);//将flag传给jsp out.close(); } jsp接收响应 并对数据进行处理 $.ajax({ type : 'post', url : 'sendServlet', cache : false, dataType : 'json', async : false, //因为ajax默认是异步调用的,所以得到的返回值是空值,要得到值必须改成同步:async: false success : function(data) { //console.log(data.result.note) for (var i in data) { console.log(data[i]) note = new Note(); note.id = data[i].note_id; note.text = data[i].note; note.timestamp = new Date().getTime(); note.left = data[i].left; note.top = data[i].top; note.zIndex = data[i].zindex; } }, error : function(msg) { //ajax请求失败后触发的方法 //弹出错误信息 console.log(msg); } }); 中间用到的jar包以及js https://pan.baidu.com/s/1XEOkM1as_10I92WAzooBuA 密码:gix8

优秀的个人博客,低调大师

Docker Hub工作流程-Docker for Web Developers(6)

在Github上创建项目仓库 和创建其他Github项目一样,在Github创建一个仓库,然后在仓库里面增加一个dockerfile,然后提交并推送到Github上。 我已经创建的仓库地址:https://github.com/liminjun/simple-dockerfile Dockerfile内容如下: #FROM - Image to start building on. FROM ubuntu:14.04 #MAINTAINER - Identifies the maintainer of the dockerfile. MAINTAINER liminjun2007@gmail.com #RUN - Runs a command in the container RUN echo "Hello World" > /root/hello_world.txt #CMD - Identifies the command that should be used by default when running the image as a container. CMD ["cat", "/root/hello_world.txt"] 在Docker Hub上构建工作流 步骤1:注册Dockerhub并登录。 步骤2:基于Github仓库创建自动化构建 选择Github 步骤3:查看Build Settings 步骤4:查看Build Details 构建和迭代我们的项目 本地修改Dockerfile文件,提交并推动到Github上。 验证上述发生的变化。 获取镜像,并运行,查看内容是否变化。 docker pull bage88/simple-dockerfile 运行Docker镜像 docker run 因为Docker Hub访问速度问题,而且企业内部开发的代码都需要打包成私有的镜像。所以Docker Hub适合开源的小型项目。 对于企业内部来说,可以使用国内云计算厂商提供的镜像服务,也可以在企业内部搭建。 本文转自快乐八哥博客园博客,原文链接http://www.cnblogs.com/liminjun88/p/docker-hub-workflows.html如需转载请自行联系原作者 快乐八哥

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册