struts2+jquery+ajax异步提交
struts2版本:struts-2.1.8.1
异常:java.lang.NoClassDefFoundError: com/opensymphony/xwork2/util/TextUtils
原因:jsonplugin-0.34.jar 配合 struts2-core-2.1.8.1.jar 使用的情况下报的异常,但以前的项目中jsonplugin-0.34.jar 配合 struts2-core-2.1.6.jar 使用不会出现这样的异常
解决方法:去掉jsonplugin-0.34.jar,使用struts2-json-plugin-2.1.8.1.jar 和 json-lib-2.1.jar,struts2-junit-plugin-2.1.8.jar三个包
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/wzlas111/archive/2010/04/05/5451462.aspx
相关文档:
页面代码:
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManage ......
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<asp:updatepanel ID="UP" runat="server">
<ContentTemplate>
......
http://hi.baidu.com/cxzhang/blog/item/0166563892cc65fbb211c7b0.html.
http://topic.csdn.net/t/20030527/22/1842509.html
using System;
using System.Data;
using System.Text;
using System.Collections.Generic;
using System.Reflection;
public class ToJson
{
/// <summary>
......
ScriptManager.RegisterStartupScript(p1, this.GetType(), "click", "alert('ok')", true);//p1是updatepanel的id
ScriptManager.RegisterStartupScript(p1, this.GetType(), "click", "alert('ok')", true);//p1是updatepanel的id
......