Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: New & Improved

  1. #11
    Join Date
    Nov 2005
    Location
    Fairfield, CT
    Posts
    21

    Default

    I've been following the SpringAir sample code for my own web app and ran into a similar problem. The Controller property of the Spring Page class defaults to the page itself when it and the page process instance are null. So a workaround is to change the BookTripController property as follows works:
    Code:
    public new BookTripController Controller
        {
            get 
            {
                if (base.Controller is Page)
                    base.Controller = new BookTripController();
                
                return (BookTripController) base.Controller; 
            }
            set { base.Controller = value; }
        }
    That will get you past that error, but there are a few others that popped up for me, requiring some commenting out of validation and databinding code...

    I haven't gotten SpringAir working, but I did get it to the same error state as my own application - :wink:

    The problem I'm now having is that the Process instance for my page is always null... Following the SpringAir example, I'm using the AnthemProcess. What I can't figure out is how the Process is injected into the Page. In the BookTrip web.config, I see how the controller is injected into the process, but I don't see how the process gets into the page...

  2. #12
    Join Date
    Sep 2004
    Location
    Belgrade, Serbia
    Posts
    613

    Default

    Strange, AnthemProcess works just fine on my dev box, and it sets controller properly on the page.

    I'll take a look at it and see if I maybe forgot to include something, although I doubt it, as CVS shows that my local copy is in sync with the repository.

    Later,

    Aleks

  3. #13
    Join Date
    Nov 2005
    Location
    Fairfield, CT
    Posts
    21

    Default

    I was able to get my app working (and SpringAir) by setting the Process property of my views as follows:
    Code:
    <object type="TripForm.aspx" parent="standardPage">
            <property name="Process" ref="BookTrip" />
    				<property name="TripValidator" ref="tripValidator" />
    			</object>

  4. #14
    Join Date
    Sep 2004
    Location
    Belgrade, Serbia
    Posts
    613

    Default

    Oh, I know what the problem is -- the lack of documentation and explanation on my part :oops:

    Once you have process in place, it is the *process* and not the page that you should point your web browser to. In the case of SpringAir2, you need to point the start page to 'BookTrip.aspx' instead of 'TripForm.aspx', as it used to be. That will trigger creation of the process instance and its retrieval on each page request.

    The solution you described seems to work, but it really doesn't -- the whole point of the process is that a single instance of the process and controller/presenter should exist for the duration of the process, even though there will typically be many different page instances that use it. That's what enables transparent state management within the process.

    In your example, new process instance will be created for each HTTP request, with new, empty state in the controller, so while it *might* work, it really won't be working according to the process semantics.

    Sorry about that, I should've made it clear up front that process *is* an IHttpHandler and that you should direct your browser to the process and not to the page within the process.

    Regards,

    Aleks

  5. #15
    Join Date
    Nov 2005
    Location
    Fairfield, CT
    Posts
    21

    Default

    That works perfectly! Thanks Aleks. This is very cool. I especially like the Anthem integration...

  6. #16
    Join Date
    Oct 2005
    Location
    Toulouse, France
    Posts
    1,409

    Default

    Cool !
    I gonna give it another try then, i thought there was some synchronisation problems between 'SpringAir.Web' and 'SpringAir2.Web' directory.

    -Bruno
    My english is as poor as my taylor is rich

  7. #17
    Join Date
    Mar 2006
    Location
    Ukraine, CR
    Posts
    11

    Default One more problem with SpringAir2

    Hi Aleks! Thanks for a help with Start up of SpringAir2. You were right I'm set start up page as BookForm.aspx and didn't read web.config to understand that BookTrip.aspx is start up point of the application. So it works fine but I got one more problem with validator configuration. This is below:

    Spring.Objects.InvalidPropertyException was unhandled by user code
    Message="'RoundTrip' node cannot be resolved for the specified root context."
    Source="Spring.Core"
    OffendingPropertyName="RoundTrip"
    StackTrace:
    at Spring.Expressions.PropertyOrFieldNode.InitializeN ode(Object context) in D:\home\projects\Spring.NET\src\Spring\Spring.Core \Expressions\PropertyOrFieldNode.cs:line 128
    at Spring.Expressions.PropertyOrFieldNode.Get(Object context, IDictionary variables) in D:\home\projects\Spring.NET\src\Spring\Spring.Core \Expressions\PropertyOrFieldNode.cs:line 145
    at Spring.Expressions.BaseNode.GetValue(Object context, IDictionary variables) in D:\home\projects\Spring.NET\src\Spring\Spring.Core \Expressions\BaseNode.cs:line 99
    at Spring.Expressions.Expression.Get(Object context, IDictionary variables) in D:\home\projects\Spring.NET\src\Spring\Spring.Core \Expressions\Expression.cs:line 112
    at Spring.Expressions.BaseNode.GetValue(Object context, IDictionary variables) in D:\home\projects\Spring.NET\src\Spring\Spring.Core \Expressions\BaseNode.cs:line 99
    at Spring.Expressions.OpEqual.Get(Object context, IDictionary variables) in D:\home\projects\Spring.NET\src\Spring\Spring.Core \Expressions\OpEqual.cs:line 62
    at Spring.Expressions.BaseNode.GetValue(Object context, IDictionary variables) in D:\home\projects\Spring.NET\src\Spring\Spring.Core \Expressions\BaseNode.cs:line 99
    at Spring.Validation.BaseValidator.EvaluateWhen(Objec t rootContext, IDictionary contextParams) in D:\home\projects\Spring.NET\src\Spring\Spring.Core \Validation\BaseValidator.cs:line 187
    at Spring.Validation.ValidatorGroup.Validate(Object validationContext, IDictionary contextParams, ValidationErrors errors) in D:\home\projects\Spring.NET\src\Spring\Spring.Core \Validation\ValidatorGroup.cs:line 100
    at Spring.Validation.ValidatorGroup.Validate(Object validationContext, IDictionary contextParams, ValidationErrors errors) in D:\home\projects\Spring.NET\src\Spring\Spring.Core \Validation\ValidatorGroup.cs:line 104
    at Spring.Web.UI.Page.Validate(Object validationContext, IValidator[] validators) in D:\home\projects\Spring.NET\src\Spring\Spring.Web\ Web\UI\Page.cs:line 810
    at TripForm.OnLoadComplete(EventArgs e) in d:\home\projects\Spring.NET\examples\Spring\Spring Air\src\SpringAir2.Web\Web\BookTrip\TripForm.aspx. cs:line 116
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    If remove validators then it works fine. Could you help me? what is wrong?

    Thanks in advance

  8. #18
    Join Date
    Sep 2004
    Location
    Belgrade, Serbia
    Posts
    613

    Default

    Sorry, I modified expression evaluator a bit recently, and the change requires enum values to be either quoted or prefixed with the enum type name.

    All you need to do is add single quotes around RoundTrip in the validator definition and everything should work fine. I will make sure I do the same before I commit the code next time, but in the meantime that would allow you to play with the app.

    Regards,

    Aleks

  9. #19
    Join Date
    Mar 2006
    Location
    Ukraine, CR
    Posts
    11

    Default

    Aleks, Thanks for a quick response! It works fine!

    I have add'l question: I think it would be better if I will post found issues to your bag-tracking system (I found component named SPRING-WEB) instead this forum. Does it make sense?

    P.S. I would like work with Spring.Web for ASP.NET 2.0

  10. #20
    Join Date
    Sep 2004
    Location
    Belgrade, Serbia
    Posts
    613

    Default

    Absolutely -- if you find something that you think is a bona fide bug, feel free to enter it into JIRA. That makes it much easier for us to keep track of everything and increses its chances of actually being resolved

    Later,

    Aleks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •