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
Ïà¹ØÎĵµ£º
JSP½Å±¾Öаüº¬9¸öÄÚÖöÔÏó£¬Õâ9¸öÄÚÖöÔÏó¶¼ÊÇServlet API½Ó¿ÚµÄʵÀý£¬Ö»ÊÇJSP¹æ·¶½«ËüÃÇÍê³ÉÁËĬÈϳõʼ»¯£¨ÓÉJSPÒ³Ãæ¶ÔÓ¦ServletµÄ_jspService()·½·¨À´´´½¨ÕâЩʵÀý£©¡£Ò²¾ÍÊÇ˵£¬ËüÃÇÒѾÊǶÔÏ󣬿ÉÒÔÖ±½ÓʹÓá£9¸öÄÚÖöÔÏóÒÀ´ÎÈçÏ£º
application£ºjavax.servlet.ServletContextµÄʵÀý£¬¸ÃʵÀý´ú±íJSPËùÊôµÄWebÓ ......
XMLÎļþ
<?xml version="1.0" encoding="utf-8"?>
.......
ÒòΪÔÒòºÜ¶à£¬ËùÒÔÕâ¸ö·½·¨²»Ò»¶¨Äܽâ¾öÎÊÌâ
XMLDocument1.LoadfromFile('test.XML');
XMLDocument1.Active:=TRUE;
XMLDocument1.Encoding:='gb2312';
memo1.Text:=XMLDocument1.XML.Text; ......
´´½¨ÎĵµÀàÐÍÉùÃ÷
Ò»°ã¶øÑÔ£¬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 ......
½ñÌìÊÔÁ˸öXMLºÍJavaBeanת»»µÄÈí¼þJOX£¬Ö®Ç°Ò»Ö±ÓÐÕâÑùµÄÐèÇ󣬵«±È½ÏÀ´±È½ÏÈ¥»¹ÊÇÕâ¸ö±È½Ï¼òµ¥ÊµÓá£ÎÒÏë³ý·ÇÎÒÓÐWSµÄÐèÇ󣬷ñÔòÏóJIBXºÍAPACHE µÄWS¹¤¾ß¶ÔÎÒÀ´Ëµ¶¼ÊÇÖØÁ¿¼¶µÄ¡£
ÏÈ¿´¿´Êä³ö½á¹û£º
<?xml version="1.0" encoding="ISO-8859-1"?>
<ApproxItem java-class="com.greatwall.csi.np.model.Approx ......
JSPͬÑùÊÇʵÏÖ¶¯Ì¬ÍøÒ³µÄÒ»¸öÀûÆ÷¡£ÓÉÓÚËûµÄ½Å±¾ÓïÑÔÊÇJAVA£¬ËùÒԼ̳ÐÁËJAVAÖî¶àÓŵ㡣ÄÇôÓëASPÏà±È£¬Ó¦¸Ã¿ÉÒÔ˵ASPºÍJSP»ù±¾²»ÊÇÒ»¸öµµ´ÎÉϵġ£ÄÇôASP.NETºÍJAVAÈ´ÊÇ¿ÉÒÔ¿¹ºâµÄ¡£
JSPºÍASPÏà±È½Ï£º ÔËÐÐËٶȡ¢ÔËÐпªÏú¡¢ÔËÐÐƽ̨¡¢À©Õ¹ÐÔ¡¢°²È«ÐÔ¡¢º¯ÊýÖ§³Ö¡¢³§ÉÌÖ§³Ö¡¢¶ÔXMLµÄÖ§³ÖµÈµÈ£¬ASP¶¼²»ÊÇJSPµÄ¶ÔÊÖ¡£COM ......