代码改变世界

随笔档案-2012年6月12日

android执行Linux命令

2012-06-12 23:00 by javaspring, 1852 阅读, 收藏,
摘要: Process localProcess = Runtime.getRuntime().exec("su");这条代码获得root权限OutputStream localOutputStream = localProcess.getOutputStream();DataOutputStream localDataOutputStream = new DataOutputStream(localOutputStream);从Process对象获得输出流,然后我们就可以执行Linux命令了localDataOutputStream.writeBytes(String str); 阅读全文

struts.xml 属性介绍

2012-06-12 22:20 by javaspring, 476 阅读, 收藏,
摘要: 一、Struts2配置文件 Struts2相关的配置文件有web.xml,struts.xml,struts.properties, struts-default.xml,velocity.properties,struts-default.vm。其中web.xml,struts.xml是必须的,其它的配置文件可选择。它们在web应用中的功能如下:web.xml:包含所有必须的框架组件的web部署描述符。 Struts.xml:配置包含result/view类型、action映射、拦截器等的Struts2的主要配置文件。 Struts.properties:配置struts2的框架属性。 St 阅读全文

struts2标签

2012-06-12 22:15 by javaspring, 239 阅读, 收藏,
摘要: A: <s:a xhref=""></s:a>-----超链接,类似于html里的<a></a> <s:action name=""></s:action>-----执行一个view里面的一个action <s:actionerror/>-----如果action的errors有值那么显示出来 <s:actionmessage/>-----如果action的message有值那么显示出来 <s:append></s:append>--- 阅读全文

struts.xml 文件

2012-06-12 22:12 by javaspring, 228 阅读, 收藏,
摘要: 该文件也是struts2框架自动加载的文件,在这个文件中可以定义一些自己的action,interceptor,package等,该文件的package 通常继承struts-default包。下面是这个文件的格式。<?xml version="1.0" encoding="GBK"?> <!-- 下面指定Struts 2.1配置文件的DTD信息 --> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 阅读全文

js调用后台,后台调用前台等方法总结

2012-06-12 00:12 by javaspring, 550 阅读, 收藏,
摘要: 1. javaScript函数中执行C#代码中的函数:方法一:1、首先建立一个按钮,在后台将调用或处理的内容写入button_click中;2、在前台写一个js函数,内容为document.getElementByIdx("btn1").click();3、在前台或后台调用js函数,激发click事件,等于访问后台c#函数;方法二:1、函数声明为public 后台代码(把public改成protected也可以)public string ss(){return("a");}2、在html里用 <%=fucntion()%>可以调用前台脚本& 阅读全文