关于控件postback 后viewstate加载失败的问题

我写了一个控件Inherits TextBox,里面有一个复杂属性Tip,但每次postback的时候都说加载viewstate失败,除非我在!postback的情况下给Tip.xxx赋值.

下面我贴出代码,我已经搞了一天了,搞不出什么原因。


JTextBox控件
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Madou.WebControls
{
    [DefaultProperty(
"Text")]
    [ParseChildren(
true), PersistChildren(false)]
    [ToolboxData(
"<{0}:JTextBox runat=server></{0}:JTextBox>")]
    
public class JTextBox : System.Web.UI.WebControls.TextBox
    
{

        
public JTextBox()
        
{
            BackColor 
= System.Drawing.Color.Beige;
           
        }


        
"Private"#region"Private"
        
private ClipTipComponent _tip;
        
#endregion


        
"定义属性"#region"定义属性"
        [Bindable(
true)]
        [Category(
"Behavior")]
        [Description(
"Tip")]
        [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]        
        [PersistenceMode(PersistenceMode.InnerProperty)]
        [NotifyParentProperty(
true)]
        
public virtual ClipTipComponent Tip
        
{
            
get
            
{
                
if (_tip == null)
                
{
                    _tip 
= new ClipTipComponent();
                    
if (IsTrackingViewState)
                    
{
                        ((IStateManager)_tip).TrackViewState();
                    }


                }

                
return _tip;
            }

        }


        
#endregion


        
"override"#region"override"

     
        
state management#region state management
        
protected override void LoadViewState(object savedState)
        
{
            Pair p 
= savedState as Pair;
            
//HttpContext.Current.Response.Write(savedState.GetType().ToString());
           
// HttpContext.Current.Response.Write(savedState==null);
           
// HttpContext.Current.Response.End();
            if (p != null)
            
{
                
base.LoadViewState(p.First);
                ((IStateManager)Tip).LoadViewState(p.Second);
               
            }

            
else
            
{
                
base.LoadViewState(savedState);
            }

          
        }


        
protected override object SaveViewState()
        
{
            
object baseState = base.SaveViewState();
            
object thisState = null;

            
if (Tip != null)
            
{
                thisState 
= ((IStateManager)Tip).SaveViewState();
            }


            
if (thisState != null)
            
{
                
return new Pair(baseState, thisState);
            }

            
else
            
{
                
return baseState;
            }


        }


        
protected override void TrackViewState()
        
{
            
if (_tip != null)
            
{
                ((IStateManager)_tip).TrackViewState();
            }

            
base.TrackViewState();
        }

        
#endregion


        
protected override void OnPreRender(EventArgs e)
        
{
            Tip.RegisterJs(
this);
            
base.OnPreRender(e);
        }

        
protected override void OnLoad(EventArgs e)
        
{
            
if (!Page.IsPostBack)
            
{
                Tip.CloseText 
= "关闭";
            }

            
base.OnLoad(e);
        }


        
#endregion

    }

}

Tip属性类
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Madou.WebControls.Converter;
namespace Madou.WebControls
{
    [TypeConverter(
typeof(ClipTipComponentConverter))]
    
public class ClipTipComponent : IStateManager
    
{
        
"Private"#region"Private"
        
private bool _isTrackingViewState;
        
private StateBag _viewState;
        
#endregion


        
public ClipTipComponent() { }

        
"属性"#region"属性"
        [Category(
"Behavior")]
        [DefaultValue(
false)]
        [Description(
"是否启用Ajax效果")]
        [NotifyParentProperty(
true)]
        
public bool EnabledAjax
        
{
            
get
            
{
                
return ViewState["EnabledAjax"== null ? false : Convert.ToBoolean(ViewState["EnabledAjax"]);
            }

            
set
            
{
                ViewState[
"EnabledAjax"= value;
            }

        }


      

        
/**//// <summary>
        
/// 是否使用Tip功能
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
true)]
        [Description(
"是否使用ClipTip功能")]
        [NotifyParentProperty(
true)]
        
public bool EnabledClipTip
        
{
            
get
            
{
                
return ViewState["EnabledClipTip"== null ? true : Convert.ToBoolean(ViewState["EnabledClipTip"]);
            }

            
set
            
{
                ViewState[
"EnabledClipTip"= value;
            }

        }

        
/**//// <summary>
        
/// // The width of the clueTip
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
"275")]
        [Description(
"The width of the clueTip")]
        [NotifyParentProperty(
true)]
        
public string TipWidth
        
{
            
get
            
{
                
return ViewState["TipWidth"== null ? "275" : ViewState["TipWidth"].ToString();
            }

            
set
            
{
                ViewState[
"TipWidth"= value;

            }

        }

        
/**//// <summary>
        
/// // The height of the clueTip.
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
"auto")]
        [Description(
"The height of the clueTip")]
        [NotifyParentProperty(
true)]
        
public string TipHeigth
        
{
            
get
            
{
                
return ViewState["TipHeigth"== null ? "auto" : ViewState["TipHeigth"].ToString();
            }

            
set
            
{
                ViewState[
"TipHeigth"= value;
            }

        }


        
/**//// <summary>
        
/// A character used to split the title attribute into the clueTip title and divs
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
"")]
        [Description(
"A character used to split the title attribute into the clueTip title and divs")]
        [NotifyParentProperty(
true)]
        
public string SplitTitle
        
{
            
get
            
{
                
return ViewState["SplitTitle"== null ? string.Empty : Convert.ToString(ViewState["SplitTitle"]);
            }

            
set
            
{
                ViewState[
"SplitTitle"= value;
            }

        }


        
/**//// <summary>
        
/// show title bar of the clueTip, even if title attribute not set
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
true)]
        [Description(
"show title bar of the clueTip, even if title attribute not set")]
        [NotifyParentProperty(
true)]
        
public bool ShowTitle
        
{
            
get
            
{
                
return ViewState["ShowTitle"== null ? true : Convert.ToBoolean(ViewState["ShowTitle"]);
            }

            
set
            
{
                ViewState[
"ShowTitle"= value;
            }

        }

        
/**//// <summary>
        
/// his is also used for a "directional" class on the same div, depending on where the clueTip is in relation to the invoking element. The class appears in the form of 'cluetip-' + direction + cluetipClass. this allows you to create your own clueTip theme in a separate CSS file or use one of the three pre-packaged themes: default, jtip, or rounded.
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
"default")]
        [Description(
"default, jtip, or rounded")]
        [NotifyParentProperty(
true)]
        [Bindable(
false)]
        [TypeConverter(
typeof(Madou.WebControls.Converter.ClueTipClassConverter))]
        
public string ClueTipClass
        
{
            
get
            
{
                
return ViewState["ClueTipClass"== null ? "default" : Convert.ToString(ViewState["ClueTipClass"]);
            }

            
set
            
{
                ViewState[
"ClueTipClass"= value;
            }

        }


        
/**//// <summary>
        
/// class applied to the invoking element onmouseover and removed onmouseout
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
"")]
        [Description(
"class applied to the invoking element onmouseover and removed onmouseout")]
        [NotifyParentProperty(
true)]
        
public string HoverClass
        
{
            
get
            
{
                
return ViewState["HoverClass"== null ? string.Empty : Convert.ToString(ViewState["HoverClass"]);
            }

            
set
            
{
                ViewState[
"HoverClass"= value;
            }

        }




        
/**//// <summary>
        
/// if true, displays arrow on appropriate side of clueTip. more info below [8]
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
false)]
        [Description(
"if true, displays arrow on appropriate side of clueTip")]
        [NotifyParentProperty(
true)]
        
public bool Arrows
        
{
            
get
            
{
                
return ViewState["Arrows"== null ? false : Convert.ToBoolean(ViewState["Arrows"]);
            }

            
set
            
{
                ViewState[
"Arrows"= value;
            }

        }


        [Category(
"Behavior")]
        [DefaultValue(
true)]
        [Description(
"是否有Shadow")]
        [NotifyParentProperty(
true)]
        
public bool DropShadow
        
{
            
get
            
{
                
return ViewState["DropShadow"== null ? true : Convert.ToBoolean(ViewState["DropShadow"]);
            }

            
set
            
{
                ViewState[
"DropShadow"= value;
            }

        }


        [Category(
"Behavior")]
        [DefaultValue(
6)]
        [Description(
"Shadow Steps")]
        [NotifyParentProperty(
true)]
        
public int DropShadowSteps
        
{
            
get
            
{
                
return ViewState["DropShadowSteps"== null ? 6 : Convert.ToInt32(ViewState["DropShadowSteps"]);
            }

            
set
            
{
                ViewState[
"DropShadowSteps"= value;
            }

        }


        
/**//// <summary>
        
/// 如果ture,鼠标点击close才关闭
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
false)]
        [Description(
"如果ture,鼠标点击close才关闭")]
        [NotifyParentProperty(
true)]
        
public bool Sticky
        
{
            
get
            
{
                
return ViewState["Sticky"== null ? false : Convert.ToBoolean(ViewState["Sticky"]);
            }

            
set
            
{
                ViewState[
"Sticky"= value;
            }

        }


        
/**//// <summary>
        
/// close when clueTip is moused out
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
false)]
        [Description(
"close when clueTip is moused out")]
        [NotifyParentProperty(
true)]
        
public bool MouseOutClose
        
{
            
get
            
{
                
return ViewState["MouseOutClose"== null ? false : Convert.ToBoolean(ViewState["MouseOutClose"]);
            }

            
set
            
{
                ViewState[
"MouseOutClose"= value;
            }

        }


        
/**//// <summary>
        
///   'hover'OR 'click',  // set to 'click' to force user to click to show clueTip
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
"hover")]
        [Description(
"hover'OR 'click'")]
        [NotifyParentProperty(
true)]
        [TypeConverter(
typeof(Madou.WebControls.Converter.ActivationConverter))]
        
public string Activation
        
{
            
get
            
{
                
return ViewState["Activation"== null ? "hover" : ViewState["Activation"].ToString();
            }

            
set
            
{
                ViewState[
"Activation"= value;
            }

        }


        
/**//// <summary>
        
/// if true, and activation is not 'click', then clicking on a clueTipped link will take user to 
        
/// the link's href, even if href and tipAttribute are equal
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
false)]
        [Description(
"if true, and activation is not 'click'")]
        [NotifyParentProperty(
true)]
        
public bool ClickThrough
        
{
            
get
            
{
                
return ViewState["ClickThrough"== null ? false : Convert.ToBoolean(ViewState["ClickThrough"]);
            }

            
set
            
{
                ViewState[
"ClickThrough"= value;
            }

        }


        
/**//// <summary>
        
///  // if true, clueTip will track mouse movement (experimental)
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
false)]
        [Description(
"if true, clueTip will track mouse movement (experimental)")]
        [NotifyParentProperty(
true)]
        
public bool Tracking
        
{
            
get
            
{
                
return ViewState["Tracking"== null ? false : Convert.ToBoolean(ViewState["Tracking"]);
            }

            
set
            
{
                ViewState[
"Tracking"= value;
            }

        }


        
/**//// <summary>
        
///  close clueTip on a timed delay (experimental)
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
0)]
        [Description(
"close clueTip on a timed delay (experimental)")]
        [NotifyParentProperty(
true)]
        
public int DelaydClose
        
{
            
get
            
{
                
return ViewState["DelaydClose"== null ? 0 : Convert.ToInt32(ViewState["DelaydClose"]);
            }

            
set
            
{
                ViewState[
"DelaydClose"= value;
            }

        }


        
/**//// <summary>
        
/// location of close text for sticky cluetips; can be 'top' or 'bottom' or 'title'
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
"top")]
        [Description(
"location of close text for sticky cluetips; can be 'top' or 'bottom' or 'title'")]
        [NotifyParentProperty(
true)]
        [TypeConverter(
typeof(Madou.WebControls.Converter.ClosePositionConverter))]
        
public string ClosePosition
        
{
            
get
            
{
                
return ViewState["ClosePosition"== null ? "top" : ViewState["ClosePosition"].ToString();
            }

            
set
            
{
                ViewState[
"ClosePosition"= value;
            }

        }


        [Category(
"Behavior")]
        [DefaultValue(
"关闭")]
        [Description(
"Close Text")]
        [NotifyParentProperty(
true)]
        
public string CloseText
        
{
            
get
            
{
                
return ViewState["CloseText"== null ? "关闭" : ViewState["CloseText"].ToString();
            }

            
set
            
{
                ViewState[
"CloseText"= value;
            }

        }

        
/**//// <summary>
        
/// 字符数
        
/// </summary>

        [Category("Behavior")]
        [DefaultValue(
0)]
        [Description(
"字符数")]
        [NotifyParentProperty(
true)]
        
public int Truncate
        
{
            
get
            
{
                
return ViewState["Truncate"== null ? 0 : Convert.ToInt32(ViewState["Truncate"]);
            }

            
set
            
{
                ViewState[
"Truncate"= value;
            }

        }


        
#endregion


        
"HELP#region"HELP

        
protected virtual StateBag ViewState
        
{
            
get
            
{
                
if (_viewState == null)
                
{
                    _viewState 
= new StateBag(true);
                    
if (_isTrackingViewState)
                        ((IStateManager)_viewState).TrackViewState();

                }

                
return _viewState;
            }

        }
              

        
#endregion


        
"重写的方法"#region"重写的方法"
        
public override string ToString()
        
{
            
return ToString(System.Globalization.CultureInfo.InvariantCulture);
        }

        
public string ToString(System.Globalization.CultureInfo culture)
        
{
            
return TypeDescriptor.GetConverter(GetType()).ConvertToString(null, culture, this);
        }



        
#endregion


        
IStateManager Members#region IStateManager Members

        
bool IStateManager.IsTrackingViewState
        
{
            
get return _isTrackingViewState; }
        }


        
void IStateManager.LoadViewState(object state)
        
{
          
            
if (state != null)
            
{
                ((IStateManager)ViewState).LoadViewState(state);

            }
           
           
        }


        
object IStateManager.SaveViewState()
        
{
            
object savedState = null;
            
if (_viewState != null)
            
{
                savedState 
= ((IStateManager)_viewState).SaveViewState();                     
            }

            
else{
            
// HttpContext.Current.Response.Write("saveState1=false");  
            }

            
return savedState;
        }


        
void IStateManager.TrackViewState()
        
{
            _isTrackingViewState 
= true;
            
if (_viewState != null)
            
{
                ((IStateManager)_viewState).TrackViewState();
            }

        }


        
#endregion


        

        
internal void SetDirty()
        
{
            _viewState.SetDirty(
true);
        }


       
internal void RegisterJs(Control target, string clientId)
        
{
            
if (target is WebControl)
            
{
                
string tooltip = (target as WebControl).ToolTip;
                
if (string.IsNullOrEmpty(tooltip.Trim()))
                
{
                    
if (!EnabledAjax)
                        
return;
                }


            }

           
            
if (EnabledClipTip)
            
{
                JavaScriptWriter w 
= new JavaScriptWriter();
                w.AddLine(
"$(function()");

                w.OpenBlock();
                
if (!EnabledAjax)
                
{
                    
if (string.IsNullOrEmpty(SplitTitle))
                        SplitTitle 
= "|";
                    w.AddLine(
"$('#" + clientId + "').cluetip({splitTitle: '" + SplitTitle + "'");
                }

                
else
                
{
                    w.AddLine(
"$('#" + clientId + "').cluetip({splitTitle: ''");
                }

                w.AddJSONItem(
"cluetipClass", ClueTipClass);
                w.AddJSONItem(
"hoverClass", HoverClass);
                w.AddJSONItem(
"arrows", Arrows);
                w.AddJSONItem(
"dropShadow", DropShadow);
                w.AddJSONItem(
"dropShadowSteps", DropShadowSteps);
                w.AddJSONItem(
"sticky", Sticky);
                w.AddJSONItem(
"mouseOutClose", MouseOutClose);
                w.AddJSONItem(
"activation", Activation);
                w.AddJSONItem(
"clickThrough", ClickThrough);
                w.AddJSONItem(
"tracking", Tracking);
                w.AddJSONItem(
"delayedClose", DelaydClose);
                w.AddJSONItem(
"closePosition", ClosePosition);
                w.AddJSONItem(
"width", TipWidth);
                w.AddJSONItem(
"height", TipHeigth);
                w.AddJSONItem(
"closeText", CloseText);
                w.AddJSONItem(
"truncate", Truncate);

                w.AddLine(
"});");
                w.CloseBlock();
                w.AddLine(
");");

                target.Page.ClientScript.RegisterClientScriptBlock(target.GetType(), clientId, w.ToString(), 
false);
            }

        }


      
internal void RegisterJs(Control target)
        
{
            
string clientId = target.ClientID;
            RegisterJs(target, clientId);
        }

    }

}



出现的问题,一定要在!PostBack给Tip.xxx赋值,否则出现viewstate不能正常加载的错误提示(如果给JTextBox的Text赋值的话),请问这个是什么原因
bug已经发现,原来System.Web.UI.WebControls.TextBox的SaveViewState()已经是Pair

转载于:https://www.cnblogs.com/genson/archive/2008/02/03/1063463.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/363808.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Java 8 Friday:语言设计很微妙

在Data Geekery &#xff0c;我们喜欢Java。 而且&#xff0c;由于我们真的很喜欢jOOQ的流畅的API和查询DSL &#xff0c;我们对Java 8将为我们的生态系统带来什么感到非常兴奋。 Java 8星期五 每个星期五&#xff0c;我们都会向您展示一些不错的教程风格的Java 8新功能&#…

linux下如何查看当前机器提供了哪些服务

答:使用netstat工具 在命令行下输入netstat -atun即可列出当前机器提供的服务 netstat各选项解析: -a 列出所有服务 -t 列出tcp相关 -u 列出udp相关 -n 以数字形式显示主机、端口或用户名转载于:https://www.cnblogs.com/dakewei/p/10414450.html

天猫浏览型应用的CDN静态化架构演变(转)

在天猫双11活动中&#xff0c;商品详情、店铺等浏览型系统&#xff0c;通常会承受超出日常数倍甚至数十倍的流量冲击。随着历年来双11流量的大幅增加&#xff0c;每年这些浏览型 系统都要面临容量评估、硬件扩容、性能优化等各类技术挑战。因此&#xff0c;架构方面的重点在于&…

jQuery表单验证的几种方法

1.jQuery的框架的验证&#xff1a;validate框架 Jquery Validate 验证规则 (1)required:true 必输字段(2)remote:”check.PHP” 使用ajax方法调用check.php验证输入值(3)email:true 必须输入正确格式的电子邮件(4)url:true 必须输入正确格式的网址(5)date:true 必须输入正确格…

h3c的gpu安装linux系统,h3c服务器u盘安装linux系统安装

弹性云服务器 ECS弹性云服务器(Elastic Cloud Server)是一种可随时自助获取、可弹性伸缩的云服务器&#xff0c;帮助用户打造可靠、安全、灵活、高效的应用环境&#xff0c;确保服务持久稳定运行&#xff0c;提升运维效率三年低至5折&#xff0c;多种配置可选了解详情什么是弹性…

查看您的Solr缓存大小:Eclipse Memory Analyzer

Solr使用不同的缓存来防止请求期间过多的IO访问和计算。 当索引不是很频繁发生时&#xff0c;您可以通过使用这些缓存来获得巨大的性能提升。 根据索引数据的结构和缓存的大小&#xff0c;它们可能会变得很大&#xff0c;并占用堆内存的很大一部分。 在本文中&#xff0c;我想展…

义务植树活动的实质

今天早上,公司来俩横横的人&#xff0c;门也不敲&#xff0c;闯进来就要找负责人&#xff0c;说他是绿化委员会的&#xff0c;问公司多少人&#xff0c;实事求是地答了。以为什么事儿呢&#xff0c;答完人家说送一通知&#xff0c;通知3月16日你们公司全体人员到新密白寨镇植树…

[Swift]LeetCode1118. 一月有多少天 | Number of Days in a Month

★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号&#xff1a;山青咏芝&#xff08;shanqingyongzhi&#xff09;➤博客园地址&#xff1a;山青咏芝&#xff08;https://www.cnblogs.com/strengthen/&#xff09;➤GitHub地址&a…

7、说说自定义注解的场景及实现

登陆、权限拦截、日志处理&#xff0c;以及各种 Java 框架&#xff0c;如 Spring&#xff0c;Hibernate&#xff0c;JUnit 提到注解就不能不说反射&#xff0c;Java 自定义注解是通过运行时靠反射获取注解。实际开发中&#xff0c;例如我们要获取某个方法的调用日志&#xff0c…

会话跟踪之Session

Session是服务端使用记录客户端状态的一种机制&#xff0c;Session使用简单&#xff0c;但是和Cookie相比&#xff0c;增加了服务器的存储压力【因为为了追求速度&#xff0c;服务器将Session放置在了内存中】。Cookie是保存在客户端的&#xff0c;然而Session是保存在服务器上…

linux 认证考试 题库,Linux认证考试题库及答案

1、一个文件的权限是-rw-rw-r--&#xff0c;这个文件所有者的权限是什么()a、read-onlyb、read-writec、write答案 b2、下面哪个值代表多用户启动()a、1b、0c、3d、5答案 c3、下面哪个文件代表系统初始化信息()a、/etc/inittabb、/etc/initc、/etc/procd、/etc/initproc答案 a4…

在NIO.2中创建文件和目录

如今&#xff0c;大量的应用程序创建文件或目录的目的非常广泛。 无论是生成报告&#xff0c;导出配置文件还是仅存储一些数据&#xff0c;能够处理这些任务都非常重要。 创建文件和目录是使用文件系统时最常用的功能之一。 图书馆的这一部分进行了相当现代化。 这方面的更新包…

实现flash的图片切换效果【可以切换多个网页或者图片】

这个是得到改进后的代码&#xff0c;可以切换多个页面 需要完整代码的朋友可以留下email如需再添加切换页面&#xff0c;只要按照下边代码部分的样式添加内容即可切换导航td的id要顺序排那个div的TOP为为上边一个div的Top加上div本身的高度&#xff1a;2371<% Page Language…

第五天

21&#xff0c;Tomcat如何修改端口号&#xff0c;如何清除项目缓存&#xff0c;默认并发量是多少&#xff1f; 端口&#xff1a;conf/server.xml 项目缓存&#xff1a;删除work文件夹下的文件 并发&#xff1a;150-200 22&#xff0c;final、finally、finalize的区别&#xff1…

websocket的加密和解密

补充个小知识点&#xff1a;按位与运算 按位与运算是同位都为1才为1&#xff0c;有一个不为1就是0 websocket_hand 1 import socket, base64, hashlib2 import websocket_jiemi3 import websocket_jiami4 5 sock socket.socket(socket.AF_INET, socket.SOCK_STREAM)6 sock.se…

《SpringMVC从入门到放肆》三、DispatcherServlet的url-pattern配置详解

上一篇我们详细解释了一下SrpingMVC的执行流程以及一些默认的配置&#xff0c;在Spring的思想中&#xff0c;就是默认大于配置。今天我们来详细的研究一下DispatcherServlet的url-pattern配置。 一、DispatcherServlet的url-pattern配置在没有特别要求的情况下&#xff0c;Spri…

linux c 指针数组定义数组长度,C/C++指针数组和 迪士尼源码搭建下载 数组指针...

迪士尼源码搭建下载【指针数组 : 存放指针的数组其定义抽象为&#xff1a;指向变量的类型 * 数组名称 [数组长度]。int *p[2];p[0] NULL;p[1] NULL;2. 数组指针 : 指向数组的指针2.0 定义抽象&#xff1a;数组元素类型 (* 指针名称)[数组长度].2.1 假设数组int a[2][2] { {1…

vc中怎么使用SendMessage自定义消息函数

vc中怎么使用SendMessage自定义消息函数&#xff1a; SendMessage的基本结构如下&#xff1a; SendMessage( HWND hWnd, //消息传递的目标窗口或线程的句柄。 UINT Msg, //消息类别&#xff08;这里可以是一些系统消息&#xff0c;也可以是自己定义&#xff0c;下文具…

tp5 修改默认的分页url

默认分页url&#xff1a;xx.com/xxx?page1 个人主要感觉不美观&#xff0c;想变成xx.com/xxx/list_1.html这样的 框架本身默认使用的boostrap分页类&#xff0c;目录位置 simplewind\thinkphp\library\think\paginator\driver\Bootstrap.php 调用url的主要是父类Paginator的ur…

多路复用IO和异步IO

多路复用I/O 它的基本原理就是select/epoll这个function会不断的轮询所负责的所有socket&#xff0c;当某个socket有数据到达了&#xff0c;就通知用户进程。 流程图如下&#xff1a; 当用户进程调用了select&#xff0c;那么整个进程会被block&#xff0c;而同时&#xff0c…