??xml version="1.0" encoding="utf-8" standalone="yes"?>
]]>
]]>
We are dedicated to make Bindows work at least as well with Mozilla 1.4+ as it does with Internet Explorer 6.0 SP1. The Mozilla support is now integral part of Bindows and we will continue to develop, maintain and support it.
However, some issues are not solved yet and this document details them.
Known Issues
Web Services
We do not yet have a working SOAP web service client working with Mozilla. Mozilla has a built in web service client but it does not yet work with all the major web services platforms. We anticipate this to be resolve in a near future version of Bindows.
Graphs, Charts and Gauges
Graphs, charts and gauges are not supported. For the Bindows charts and gauges we rely on VML to do the drawing. Mozilla does not yet have a way to draw vector graphics at the client side without using a plugin. We consider several alternatives here but there is no time frame for a solution yet.
Miscellaneous
The caret is sometimes not shown in a focused textfield. This is a Mozilla bug and unless this is fixed in Mozilla this issue will remain.
Preferred size is not working consistently. Please report the cases where you are experiencing issues with the preferred size and we will see what can be done in those specific cases.
Icons in menu items works inconsistently between Mozilla versions. This is due to differences in the Mozilla toolkits used by different browsers.
Menu labels do not accept HTML. If you use HTML, the markup will be stripped.
The rendering of the group box is incorrect.
Labels with text align center and icon position set to top or bottom are a bit jumpy, ie. the icon move around depending on the state.
Dragging elements sometimes inconsistent. If an image is dragged an OS level drag and drop is initiated. Also, for some components a dragging will not work when the mouse leaves the browser window or enters a frame.
The upper border for the tab pages are not correctly drawn in Mozilla Firefox using Windows Classic. This is a Mozilla bug.
BiKeyboardEvent keyCode is sometimes incorrect in a keypress event (for special keys). The reason for this bug is that Internet Explorer and Mozilla are handling keyboard events differently.
Resize events are not fired on all BiComponents.
Focus and blur events are inconsistent when using BiRichEdit.
]]>
If you are interested in it, you can vist the url
http://code.google.com/p/jsparse/
class Singleton
{
public:
static Singleton *instance (void)
{
if (instance_ == 0)
// Critical section.
instance_ = new Singleton;
return instance_;
}
void method (void);
// Other methods and members omitted.
private:
static Singleton *instance_;
};
class Singleton
{
public:
static Singleton *instance (void)
{
// Constructor of guard acquires lock_ automatically.
Guard guard (lock_);
// Only one thread in the critical section at a time.
if (instance_ == 0)
instance_ = new Singleton;
return instance_;
// Destructor of guard releases lock_ automatically.
}
private:
static Mutex lock_;
static Singleton *instance_;
};
static Singleton *instance (void)
{
if (instance_ == 0) {
Guard guard (lock_);
// Only come here if instance_ hasn't been initialized yet.
instance_ = new Singleton;
}
return instance_;
}
q将减少加锁负蝲Q但是不能提供线E安全的初始化。在多线E的应用中,仍然存在竞争条gQ将D多次初始化instance_。例如,考虑两个U程同时?instance_ == 0Q都会(x)成功Q一个将通过guard获取lock_另一个将被阻塞。当W一U程初始化Singleton后释放lock_Q被d的线E将获取lock_Q错误的再次初始化Singleton?
class Singleton
{
public:
static Singleton *instance (void)
{
// First check
if (instance_ == 0)
{
// Ensure serialization (guard constructor acquires lock_).
Guard guard (lock_);
// Double check.
if (instance_ == 0)
instance_ = new Singleton;
}
return instance_;
// guard destructor releases lock_.
}
private:
static Mutex lock_;
static Singleton *instance_;
};
// A Singleton Adapter: uses the Adapter
// pattern to turn ordinary classes into
// Singletons optimized with the
// Double-Checked Locking pattern.
template
class ACE_Singleton
{
public:
static TYPE *instance (void);
protected:
static TYPE *instance_;
static LOCK lock_;
};
template TYPE *
ACE_Singleton::instance ()
{
// Perform the Double-Checked Locking to
// ensure proper initialization.
if (instance_ == 0) {
ACE_Guard lock (lock_);
if (instance_ == 0)
instance_ = new TYPE;
}
return instance_;
}
// Acquire the mutex.
int Mutex_Token::acquire (void)
{
// If the token is already held, we must block.
if (mutex_in_use ()) {
// Use the Token_Mgr Singleton to check
// for a deadlock situation *before* blocking.
if (Token_Mgr::instance ()->testdeadlock ()) {
errno = EDEADLK;
return -1;
}
else
// Sleep waiting for the lock...
// Acquire lock...
}
Singleton *Singleton::instance (void)
{
if (Singleton::instance_ == 0)
{
// Only lock if instance_ isn't 0.
Guard guard (lock_);
// Dead code elimination may remove the next line.
// Perform the Double-Check.
if (Singleton::instance_ == 0)
// ...
static const int STACK_SIZE = 1000;
static T *stack_;
static int top_;
void push (T *item)
{
// First-time-in flag
if (stack_ == 0) {
stack_ = malloc (STACK_SIZE * sizeof *stack);
assert (stack_ != 0);
top_ = 0;
}
stack_[top_++] = item;
// ...
}
W一ơpush被调用时Qstack_?Q这导致触发malloc来初始化它自己?
message |
By default the tag will retrieve the request scope bean it will iterate over from the |
也就是说在将message讄为trueӞ?x)去request中寻找Globals.MESSAGE_KEY所代表的beanQ然而我们在具体的Action使用ActionMessagescȝ时候往往是这L(fng)
ActionMessages messages = getErrors(request);
messages.add(ActionMessages.GLOBAL_MESSAGE , new ActionMessage(key , value0));
saveMessages(request,messages);
而往往困扰人的在于ؓ(f)什么要lmessages中放入名UCؓ(f)"ActionMessages.GLOBAL_MESSAGE"的ActionMessage对象Q而且q需要再ơ的调用saveErrors(request,messages)Ҏ(gu)Q?/strong>
首先要说明的是你为ActionMessage起Q何的名称都没有关p,因ؓ(f)ActionMessages本nl持着一个HashMapQ而参数property是q个HashMap中的key|如果不存在则?x)徏立相应的key,q将需要保存的ActionMessage对象存入到这个key所对应的List中?br /> public void add(String property, ActionMessage message) {
ActionMessageItem item = (ActionMessageItem) messages.get(property);
List list = null;
if (item == null) {
list = new ArrayList();
item = new ActionMessageItem(list, iCount++, property);
messages.put(property, item);
} else {
list = item.getList();
}
list.add(message);
}
至于Z么一定要调用saveMessages(request,messages)Q看看它具体的实现逻辑清楚了
protected void saveMessages(
HttpServletRequest request,
ActionMessages messages) {
// Remove any messages attribute if none are required
if ((messages == null) || messages.isEmpty()) {
request.removeAttribute(Globals.MESSAGE_KEY);
return;
}
// Save the messages we need
request.setAttribute(Globals.MESSAGE_KEY, messages);
}
再对比前面介l的messagesPresent标签的用,是不是就清楚了呢Q原来它是将ActionMessages对象保存在request中,q且名称是Globals.ERROR_KEYQ从而ؓ(f)tag的顺利解析铺q了道\。当然按理你可以选择这L(fng)对象攄在Q何的scope中,但Action只是提供了request , session两种ScopeQ不qpage , application不经怋用,可以理解Q但不提供相应的l构׃太好了)
至于messagesPresent标签是如何在scope中寻找ActionMessages对象
org.apache.struts.taglib.logic.MessagesPresentTag
protected boolean condition(boolean desired) throws JspException {
ActionMessages am = null;
String key = name;
if (message != null && "true".equalsIgnoreCase(message)){
key = Globals.MESSAGE_KEY;
}
try {
am = TagUtils.getInstance().getActionMessages(pageContext, key);
} catch (JspException e) {
TagUtils.getInstance().saveException(pageContext, e);
throw e;
}
Iterator iterator = (property == null) ? am.get() : am.get(property);
return (iterator.hasNext() == desired);
}
org.apache.struts.taglib.TagUtils
public ActionErrors getActionErrors(PageContext pageContext, String paramName)
throws JspException {
ActionErrors errors = new ActionErrors();
Object value = pageContext.findAttribute(paramName);
if (value != null) {
try {
if (value instanceof String) {
errors.add(
ActionMessages.GLOBAL_MESSAGE,
new ActionMessage((String) value));
} else if (value instanceof String[]) {
String keys[] = (String[]) value;
for (int i = 0; i < keys.length; i++) {
errors.add(
ActionMessages.GLOBAL_MESSAGE,
new ActionMessage(keys[i]));
}
} else if (value instanceof ActionErrors) {
errors = (ActionErrors) value;
} else {
throw new JspException(
messages.getMessage(
"actionErrors.errors",
value.getClass().getName()));
}
} catch (JspException e) {
throw e;
} catch (Exception e) {
log.debug(e, e);
}
}
return errors;
}
PageContext中的findAttribute?x)帮你在scope中寻扑UCؓ(f)Globals.MESSAGE_KEY的ActionMessage对象?br />
注意
虽然Struts已经声明Q不推荐使用ActionErrors & ActionError对象Q但在一些遗留的pȝ中,依然q是可以看到其媄子,所以如果你的系l不q属于这L(fng)两种混合pȝQ有以下的几U方法可以参?br />
1。两ơ调用messagesPresentQ如?br /><!-- Print ActionErrors Object -->
<logic:messagesPresent>
<html:messages id="msg" message="true">
<div class="success">
<bean:write name="msg"/>
</div><br/>
</html:messages>
</logic:messagesPresent>
<!-- Print ActionMessages Object -->
<logic:messagesPresent message="true">
<html:messages id="msg" message="true">
<div class="success">
<bean:write name="msg"/>
</div><br/>
</html:messages>
</logic:messagesPresent>
2.分别使用<html:messages> <html:errors>标签Q当然在老系l中需要调用Action的saveErrorsҎ(gu)Q而在新的应用中要调用saveMessagesҎ(gu)?/font>
3.更换所有的ActionErrors为ActionMessages,q将所有调用saveErrors的地Ҏ(gu)换成saveMessagesQƈ?lt;html:errors>标签相应的更换成<html:messages message="true"> Q?推荐Q?/font>
什么是q发问题Q假设有q么一家书吧,֮可以到那里喝茶读书。顾客拿着选好要读的图书到柜台登记Q然后找个地方去阅读Q(f)走时图书归q店家。有一天,一个顾客相中了一本书后正要拿ȝ讎ͼ另一个顾客的手也抓住了这仅有的一本书Qƈ发问题出C。两个顾客要d一本书Q互不相让,q让店主伤透了脑筋。这个案例仅仅是众多q发问题中的一个微部分,但从中我们可以看出ƈ发问题主要出现在多个用户Ҏ(gu)限资源进行访问的时候,如果解决不好?x)直接媄响系l的有效、正常运行。数据库是一个共享的资源Qƈ发问题的出现是必不可免的Q如何识别ƈ发类型ƈ加以控制是这一章重点要讲述的内宏V?/p>
本章分成两大部分,一部分主要讲Visual FoxPro中ƈ发控制机制。VFP中ƈ发控制相对简单,数据加锁的Ş式比较单一Q非帔R合作ؓ(f)初步了解q发问题的切入点。第二部分以SQL Server 2000、ADO.NET以及(qing)C#Z要工P深入了解q发一致性问题、封锁协议、事务隔ȝ内容Q难度相对较深。象一些更为深入的q发控制手段Q例如多_度锁和意象锁{内容在本章中将不做深入讨论Q感兴趣可以参考相关书c?/p>
[实在不好意思COPY别h的成果,不过q篇文章出奇的精彩,ƈ发操作的来龙去脉说的清清楚楚Q也是我正要扄Q比JAVAEYE上面所谓的专家叫嚷着什?(zhn)观??乐观?而不解是原因要强的多Q值得收藏]