一个Test类xml备置
<objects xmlns="http://www.springframework.net">
<description>An example that demonstrates simple IoC features.</description>
<object id="testClass" type="spring.application.Test,spring.application">
<property name="Title" value="111"></property>
</object>
</objects>
Test类:
public class Test
{
private string m_title; public Test()
{
m_title = "00000000000";
} public string Title
{
set { m_title = value; }
get { return m_title; }
} public void Write()
{
Console.WriteLine("测试");
}
}
加上 <property name="Title" value="111"></property>话就报Error instantiating context 'spring.root'.
如果不加正确的,如果要用属性值在xml配置怎么弄
<objects xmlns="http://www.springframework.net">
<description>An example that demonstrates simple IoC features.</description>
<object id="testClass" type="spring.application.Test,spring.application">
<property name="Title" value="111"></property>
</object>
</objects>
Test类:
public class Test
{
private string m_title; public Test()
{
m_title = "00000000000";
} public string Title
{
set { m_title = value; }
get { return m_title; }
} public void Write()
{
Console.WriteLine("测试");
}
}
加上 <property name="Title" value="111"></property>话就报Error instantiating context 'spring.root'.
如果不加正确的,如果要用属性值在xml配置怎么弄
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货