易截截图软件、单文件、免安装、纯绿色、仅160KB

jsp/get/set/struts.xml存取

get
jsp         url          ${param.serialID}
action    jsp          String commentId = ServletActionContext.getRequest().getParameter("commentId");
---------------------------------------
action    ServletActionContext.getRequest().setAttribute("searchContent", searchContent);
jsp         action      <s:property value="searchContent"></s:property>
---------------------------------------
function hanshu(num)
{
    window.location.href="<%=request.getContextPath()%>/a.action?num="+num;
}
<a href="javascript:hanshu('${param.url参数名}')"></a>
=====================
post
//使用trim()
String.prototype.trim=function()
{
   return this.replace(/(^\s*)|(\s*$)/g, "");
}
function hanshu()
{
     var selectValue = document.getElementById("selectId").value;
     var textValue = document.getElementById("textId").value;
     //必填
    if(!selectValue)
     {
       alert("必填");
      }
     else if(selectValue.trim().length<1)
     {
         alert("长度");
      }
}
<form action="${pageContext.request.contextPath}/getAction.action" method="post" name="nameForm">
      <select name="seledtName" id="selectId">
               <option value="1">博客</option>
      </select>
      <input type="text" name="textName" id="textId"&g


相关文档:

PHP+DOM创建XML文件

创建文档类型声明
一般而言,XML声明放在文档顶部。在PHP中声明十分简单:只需实例化一个DOM文档类的对象并赋予它一个版本号。查看程序清单A:
程序清单 A
<?php
// create doctype
$dom = new DOMDocument("1.0");
// display document in browser as plain text
// display document in browser as plain text ......

支持几乎所有浏览器的js载入xml文件

1.route.xml文件内容
<?xml version="1.0" encoding="GBK"?>
<root>
<route id="1111">
<id>111</id>
<name>四川</name>
<path>www.baidu.com/hehe.html</path>
</route>
</root>
2.test.html代码
<html>
<body>
<script> ......

asp.net 读取Xml文件并进行DropDownList数据绑定

<asp:DropDownList ID="compactType" runat="server" AutoCallBack="True" Width="153px"> </asp:DropDownList>

<?xml version="1.0" encoding="utf-8" ?>
<roots>
<root>
<id>1</id>
<Culture> ......

xml文档里含有特殊字符时的处理方法(php)

  本文首发代码天下,转载请注明来源代码天下,谢谢。
  今天上班时遇到一个问题,游戏官反应一个用户充不了值。充不了值一般为用户角色不正确,我仔细检查发现该用户角色有点异常,因为对方返回角色是xml,我贴上来给大家看一下:
<Result value="true" message="Success!">   <It ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号