charly
06-09-2005, 03:47 PM
Greetings,
I know Spring from the Java implementation but can't manage top make it work under Dotnet :(.
So :
I have an asp.net (index.aspx) page with a code-behind class. This class has a property that I want to set through spring.
protected string texte
{
get{return texte;}
set{texte = value;}
}
and my webConf :
<spring>
<context type="Spring.Context.Support.WebApplicationContext, Spring.Web">
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net" >
<object type="index.aspx">
<property name="texte">
<value>hello from Spring.</value>
</property>
</object>
</objects>
</spring>
So I want to put that string in the "texte" property : no great deal ;).
Error Msg follows :
Exception Details: Spring.Objects.NotWritablePropertyException: Property 'texte' is not writable in object class [ASP.index_aspx]
NotWritablePropertyException: Property 'texte' is not writable in object class [ASP.index_aspx]]
Spring.Objects.ObjectWrapper.SetPropertyValues(IPr opertyValues propertyValues, Boolean ignoreUnknown)
Spring.Objects.ObjectWrapper.SetPropertyValues(IPr opertyValues pvs)
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.ApplyPropertyValues(String name, RootObjectDefinition definition, IObjectWrapper wrapper, IPropertyValues properties)
[ObjectCreationException: Error creating object with name 'index' defined in 'config [objects] line 20' : Error setting property values: Property 'texte' is not writable in object class [ASP.index_aspx]]
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.CreateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching)
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.CreateObject(String name, RootObjectDefinition definition, Object[] arguments)
Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name, Type requiredType, Object[] arguments)
Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name, Object[] arguments)
Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name)
Spring.Context.Support.AbstractApplicationContext. GetObject(String name)
Spring.Web.Support.PageHandler.ProcessRequest(Http Context context)
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication+IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +87
This must be stupid but I have read the http://opensource.atlassian.com/confluence/spring/display/NET/Spring.Web but didn't manage.
Any help would be much appreciated :)
thank you in advance.
I know Spring from the Java implementation but can't manage top make it work under Dotnet :(.
So :
I have an asp.net (index.aspx) page with a code-behind class. This class has a property that I want to set through spring.
protected string texte
{
get{return texte;}
set{texte = value;}
}
and my webConf :
<spring>
<context type="Spring.Context.Support.WebApplicationContext, Spring.Web">
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net" >
<object type="index.aspx">
<property name="texte">
<value>hello from Spring.</value>
</property>
</object>
</objects>
</spring>
So I want to put that string in the "texte" property : no great deal ;).
Error Msg follows :
Exception Details: Spring.Objects.NotWritablePropertyException: Property 'texte' is not writable in object class [ASP.index_aspx]
NotWritablePropertyException: Property 'texte' is not writable in object class [ASP.index_aspx]]
Spring.Objects.ObjectWrapper.SetPropertyValues(IPr opertyValues propertyValues, Boolean ignoreUnknown)
Spring.Objects.ObjectWrapper.SetPropertyValues(IPr opertyValues pvs)
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.ApplyPropertyValues(String name, RootObjectDefinition definition, IObjectWrapper wrapper, IPropertyValues properties)
[ObjectCreationException: Error creating object with name 'index' defined in 'config [objects] line 20' : Error setting property values: Property 'texte' is not writable in object class [ASP.index_aspx]]
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.CreateObject(String name, RootObjectDefinition definition, Object[] arguments, Boolean allowEagerCaching)
Spring.Objects.Factory.Support.AbstractAutowireCap ableObjectFactory.CreateObject(String name, RootObjectDefinition definition, Object[] arguments)
Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name, Type requiredType, Object[] arguments)
Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name, Object[] arguments)
Spring.Objects.Factory.Support.AbstractObjectFacto ry.GetObject(String name)
Spring.Context.Support.AbstractApplicationContext. GetObject(String name)
Spring.Web.Support.PageHandler.ProcessRequest(Http Context context)
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication+IExecutionStep.Execute()
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +87
This must be stupid but I have read the http://opensource.atlassian.com/confluence/spring/display/NET/Spring.Web but didn't manage.
Any help would be much appreciated :)
thank you in advance.