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
相关文档:
1. 怎么在多个JSP页面之间进行参数传递?需要使用JSP的内置作用域对象session。利用它的两个方法setAttribute(),getAttribute()
2. 下面的这个实例实现了把第一个JSP页面的参数传递给第三个页面的功能
3. &nbs ......
--本文摘自http://www.moandroid.com/?p=508
By: 海市蜃楼 | In: Android开发
3 九 2009
XML 经常用作 Internet 上的一种数据格式,其文件格式想必大家都比较清楚,在这里我结合Android平台,来说明Android SDK提供的读写XML的package。
首先介绍下Android SDK与Java SDK在读写XML文件方面,数据包之间的关系。Android ......
1 在Action实现类方面的对比:Struts 1要求Action类继承一个抽象基类;Struts 1的一个具体问题是使用抽象类编程而不是接口。Struts 2 Action类可以实现一个Action接口,也可以实现其他接口,使可选和定制的服务成为可能。Struts 2提供一个ActionSupport基类去实现常用的接口。即使Action接口不是必须实现的,只有一 ......
[System.Runtime.Serialization.DataMemberAttribute()]
public Information Archive {
get {
&n ......
解析xml文档的类库有很多种,比较常用的就是SimpleXML,DOM Document,XMLReader,基于SAX的xml_parse函数。
根据xml文档结构,以及需求的不同,要选择好对应的类库。
解析小的文档的话,使用SimpleXML比较合适,简单的几个函数就可以搞定。
如果文档非常巨大,最好是XMLReader打开,中间转换成DOM来解析,感觉DOM与XPat ......