一个特别的问题,终于解决了 isManager

解决页面属性值为空的问题

Element e2 = psHelp.query();
String isManager = “1”;
e2.addAttribute("isManager", isManager);//管理员标志
 request.setAttribute("az",e2);

但在页面得不到isManager的值,永远为空。调试了好长时间,终于知道了问题所在:可能是不能用isXXX开头的变量当作属性   :)

然而当用sManager代替isManager时,结果还是不行,仍然为空值,最后用asmanager当作属性时,一切都ok了

public class AttachedAction : BaseAction,,,foreach (BaseAction ba in this.mActionList) { //// check each action belongs to the same group one by one if (grpToEnd != null) { break; // group to end (abort/stop) has been found, 已经找到了需要结束的动作组 } if (ba.GroupID != groupID) { continue; // 'ba' does NOT belong to 'groupID' 当前动作不属于当前组 } switch (ba.State) { case ActionState.Ready: if (ba.CheckStart() && this.State != ModuleState.NotReady) // ManagerAction/AttachedAction do different thing { if (ba.IsManager && ba is CleanAction) { // <> assert: For 'ba' is 'Ready', so it must be the first one <> CleanAction ca = (CleanAction)ba; if (ca.Params == "*") // <><> NOT init { ProcessAction procAction = null; //PickAction pickAction = null; foreach (BaseAction ba1 in this.mActionList) { if (ba == ba1) { continue; } // <> check the first 'ProcessAction' // procAction = ba1 as ProcessAction; // 如果当前是CleanAction,从mActionList找到第一个 ProcessAction,并使用其参数初始化 CleanAction 的参数。 if (procAction != null) { //((CleanAction)ba).Params = procAction.Params; ca.Params = procAction.Params; // "ProcessRecipe,false" ca.Params = ca.Params.Remove(ca.Params.IndexOf(',')); // "ProcessRecipe" //ca.Params = string.Format("{0}@{1}", ca.Params, procAction.RouteName); ca.Params = string.Format("{0}@{1}@{2}", ca.Params, procAction.RouteName, procAction.MatSource); // 2024112<StartClean> xianghf_20211113 // <><><> yangy 20211129: every time rebuild 'ca.Params' OK ?? need test <><><> break; // found the first next recipe <> } } if (procAction == null) // xianghf_20211113, ??? 2024112<StartClean> { Coordinator.GetIns().GetLogger().InfoFormat("Module '{0}' SKIP reset clean action '{1}' Params for ProcessAction is NULL.", this.mFullName, ca.Name); } } } ba.Start(); // can start and module state is OK <> } break; case ActionState.Running: if (ba.IsManager && ba.CheckDone()) { grpToEnd = (ManagerAction)ba; // catch the manager, done it out of lock{}将 ba 转换为 ManagerAction 并赋值给 grpToEnd ba.Done(); // AttachedAction did this in remote service callback } break; case ActionState.Aborting: if (ba.IsManager && ba.CheckAborted()) { grpToEnd = (ManagerAction)ba; // catch the manager, aborted it out of lock{} ba.Aborted(); // AttachedAction did this in remote service callback 标记动作已被中止 } break; default: break; } // end switch } // end foreach BaseAction中Done函数:public virtual void Done() { this.State = ActionState.Done; this.mDoneTime = DateTime.Now; }AttactionAction中Done函数 public override void Done() { base.Done(); TimeSpan ts = (TimeSpan)(this.DoneTime - this.StartTime); Coordinator.GetIns().GetLogger().WarnFormat("'{0}[{1}]({2})' was 'Done'. [{3}]", this.Name, this.GroupID, this.Params, ts.TotalSeconds); }, ActionState.Running时,上面的运行过程时怎么样的,函数调用过程是什么样的,具体详细分析并说明原因。
最新发布
08-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值