使用靜態final字段(常量)是有可能與使用CoreProtocolPNames類的靜態最終字段這樣定義一個bean:春天 - 對於Bean初始化
<bean id="httpParamBean" class="org.apache.http.params.HttpProtocolParamBean">
<constructor-arg ref="httpParams"/>
<property name="httpElementCharset" value="CoreProtocolPNames.HTTP_ELEMENT_CHARSET" />
<property name="version" value="CoreProtocolPNames.PROTOCOL_VERSION">
</bean>
public interface CoreProtocolPNames {
public static final String PROTOCOL_VERSION = "http.protocol.version";
public static final String HTTP_ELEMENT_CHARSET = "http.protocol.element-charset";
}
如果可能,這樣做的最好方法是什麼?
要麼刪除問題,要麼保持原樣,但不要介於兩者之間。謝謝。 – 2010-05-24 14:58:41