PDA

View Full Version : Where is the SpringAir example?


battleace
10-18-2005, 07:31 PM
Where is the SpringAir example?

Ok, I saw the reference in the documentation but the documentation did not says that it was for the 1.1 release.
I just noticed in one of the forum cmments that this is coming out for Spring 1.1.

Anyway, thanks for the teams hard work.

Rick Evans
10-18-2005, 08:10 PM
Hi

You can download the Spring.Web preview release here (http://sourceforge.net/project/showfiles.php?group_id=106751&package_id=115147), which contains the SpringAir reference application in the examples directory off the main install directory.

I will add that this is a 'Preview' release, and that a substantial amount of work has yet to be put into the SpringAir application (documentation foremost).

Cheers
Rick

battleace
10-18-2005, 09:31 PM
Thanks Rick!

This will get me moving now!
This sample clears up a lot.

battleace
10-26-2005, 03:49 PM
I set the following path as the start directory in IIS for SpringAir but the error says <spring> object not found.

C:\Program Files\Spring.NET\Spring.NET 1.1 Spring.Web Preview\examples\Spring\SpringAir\src\SpringAir.We b\Web\BookTrip

Now I notice that all of this is defined in the web.config file of the SpringAir.Web directory.
Since you can only have one web.config per application, how is this expected to work?

The booktrip has its web.config and SpringAir.Web has its own web.config
SpringAir.Web defines the <spring> object and the Booktrip directory tries to use the <spring> object.
This does not work. The web.config of the booktrip directory should define the spring object also. Should I use the SpringAir.Web's web.config
inside of the BookTrip directory?

macher
10-26-2005, 06:10 PM
>>>>Since you can only have one web.config per application, how is this expected to work?

each directory can have a web.config, but certain settings, which are valid application-wise, like httpmodules, authentication, can reside in the web.config in the root directory

battleace
11-02-2005, 08:58 PM
Im not too clear about your reply, but how can I fix the example to stop showing the "unrecognized configuration section spring" error?
The example has multiple web.configs and the one assigned to the booktrip example does not have the spring object defined . The directory level above has a config section for spring. I cant get the example to work due to this error.
Rick or Alek help.
Thanks

Rick Evans
11-02-2005, 11:11 PM
Hi Ace

Ok, lets try this from the top (forgive me if I am going down that whole grandma and eggs route).

You need to have the following directory set as your virtual directory in IIS...

C:\Program Files\Spring.NET\Spring.NET 1.1 Spring.Web Preview\examples\Spring\SpringAir\src\SpringAir.We b\

The Web.config file in this root directory is where the handler for the <spring/> configuration element is defined. So long as this is the case, you will be good to go. For what it is worth, I am using the SpringAir that is available as a download from the SourceForge site (and not the version in the CVS HEAD) and everything is cool for me. Thanks for sticking in there... I want to help, so if you still can't get this working do ping back.

Ciao
Rick

Aleks Seovic
11-03-2005, 12:43 AM
As Rick said, you need to configure SpringAir virtual directory in IIS to point to examples\Spring\SpringAir\src\SpringAir.Web, not BookTrip directory.

It is not true that you can have only one Web.config file per application. As Macher pointed out, you can have as many Web.config files as you want, one per directory within the web application. Down-level config files can override or remove the settings from the up-level files and add new settings. This is standard ASP.NET feature and you would typically use it to configure different access permissions for certain folders within the application ('admin' folder is a classic example).

Spring.NET leverages this feature to implement support for context hierarchy within web application. Object definitions within down-level context, such as BookTrip, can access all the definitions from the up-level contexts (root context in this case). However, the opposite is not true. Sibling contexts also cannot see each other's definitions.

This allows you to better modularize your application and to keep each context relatively small and definitions somewhat hidden. For example, you could define child contexts for BookTrip, BookHotel and ProcessPayment components that contain related page and control definitions. Your root context would contain common object definitions, such as abstract base page and master page, localization-related definitions, global services, DAOs and aspects, etc.

This is exactly what SpringAir demonstrates by defining separate child context for the BookTrip component.

HTH,

Aleks

battleace
11-03-2005, 05:46 AM
You guys rock! You cleared up a lot and taught me something I did not fully understand.
Thanks !

battleace
11-09-2005, 12:06 AM
Ok. I started from scratch and followed the directions in the readme file.
I get the following error.

Line 1: <%@ Application Inherits="SpringAir.Global" Language="C#" %>


I think that the version of SpringAir is newer than the support documentation.
Any idea how I can fix this?
I know this is a generic error but maybe you guys know what I am missing.
Thanks

battleace
11-10-2005, 04:52 PM
No Help?

Bruno Baia
11-10-2005, 05:37 PM
generally, u have this kind of error when u try to run a web application where assemblies are missing (maybe the compilation wasn't ok ?) because the Global.asax file is the first to be processed.

battleace
11-10-2005, 07:31 PM
Thanks. I got it working. The example should be in sepatrate solutions so that we can easily understand what is going on. There are little things that I did or failed to do that prevented me from running the app. Spring air should be zipped separately and have its own solution. With so many projects and directories under the root, I did not know where to start. Yes it was simple once I saw what I was doing wrong but the examples should be packaged separately so that this is not confusing.

Rick Evans
11-11-2005, 01:07 PM
Hiya

Good idea... I have created a JIRA issue (http://opensource2.atlassian.com/projects/spring/browse/SPRNET-234) to address this in time for the 1.1 final release.

Ciao
Rick

Aleks Seovic
11-11-2005, 05:14 PM
I don't think we should package them separately, but what we should do is add shortcuts to each sample app to Spring.NET menu, along the lines of what EL does for QuickStarts.

SpringAir already has a separate solution, so I don't see a problem there...

- Aleks

Rick Evans
11-11-2005, 05:30 PM
Hi

I don't think that's the nub of the issue.

Application developers who want to use Spring.NET should not have to open up a solution that contains 10 or so projects just to see how to use Spring.NET (and Spring.Web). And remember that when I commit the IBatis.NET implementation of the data access layer that is going to add yet another project to the mix... and lets not forget the associated test project too. And we will also probably have an NHibernate impementation of the data access layer too (also with its own test project).

The current SpringAir project references other projects (Spring.Core, Spring.AOP, all the tests projects, etc) directly (via project references). What I think it should do is reference Spring.* dll's in a bin (or lib) folder (assembly references) so that developers can crack open SpringAir and see how to use Spring.Web and Spring.NET without having to wait while every single referenced Spring project opens up. Compiling SpringAir should be about compiling SpringAir, not about having to wait while all of the other projects are compiled too. If developers then want to mount the other projects then they can do so explicitly.

By way of a precedent, the example application from the IBatis.NET project doesn't reference the core IBatis.NET projects directly, rather it references the pre-compiled assemblies that come with the current release.

And for my next magic trick, I'm now going to pull the carpet out from under my feet by saying that, well, ok, we don't have to do this :) I'm easy either way really... I guess we can let the users decide what they want.

Ciao
Rick

Aleks Seovic
11-11-2005, 06:53 PM
Sorry, completely forgot about that...

Yeah, I definitely agree on that one -- SpringAir solution that users start from the Start menu should only contain SpringAir assemblies that reference binary versions of all necessary Spring.NET assemblies. The only reason SpringAir solution looks the way it does is that it makes development easier, but there is no reason users browsing the samples have to see all those projects.

However, I'd wait and make those changes right before the release. Right now it is much easier to develop sample apps with all project references in place.

Later,

Aleks

battleace
11-15-2005, 03:13 PM
Thanks guys. Sounds like an excellent ideas!