spring

is SFig language syntax efficient and clear (and better than Spring-Framework's XML DSL)?

ADDENDUM EDIT: Have not accepted an answer to this as there has not been any feedback from experienced Spring Framework developers. I've been working on a replacement DSL to use for Spring-Framework applicationContext.xml files (where bean initialization and dependency relationships are described for loading up into the Sprin...

Limit Access To a Spring MVC Controller -- N sessions at a time

We've licensed a commercial product (product not important in this context), which is limited by the number of concurrent users. Users access this product by going through a Spring Controller. We have N licenses for this product, and if N+1 users access it, they get a nasty error message about needing to buy more licenses. I want to m...

Grails getSomething(int i) method doesn't compile

Can someone tell me why this Grails domain class will not compile (at runtime)? class Person { String name String getSomething(int i) { } } I get this error when I run with grails run-app: 2008-12-27 15:26:33.955::WARN: Failed startup of context org.mortbay.jetty.webapp.WebAppContext@187e184{/asrs2,C:\Steve\asrs2/web-ap...

Grails File Download

Hi there, I'm trying to craete a site which allows users to upload any file type they like. I've implemented this feature fine, and the file is held on the server. Later on they can download the file to view, but i'm having trouble getting it to work. I've used any examples I can get hold of but they all tend to use text files as examp...

Spring SP Class generation with or without Eclipse

With Hibernate+Eclipse you can generate POJO classes that represent the tables. You can then wire it all together pretty easily with Spring. However, if you have to interact with stored procedures you have to wrap each one in it's own class(es) -- although this is definitely preferred to standard JDBC it is still a bit cumbersome at time...

HibernateTransactionManager(Spring) with multiple Session Factories

I have a DAO implementation that uses a HibernateTransactionManager for transaction management and the application has 2 session factories. I am getting an exception at the transactionManager.commit() line below. Does performing Hibernate operations within a transaction manager related to a different session factory cause problems? Tran...

Spring Exchange 2009 expectations

Hi, The company I work for as kindly agreed to pay for me to go to Spring Exchange 2009 in London. I've never been able to go to something like this before due to the cost aspect, so I have no idea what to expect from the day. What should my general expectations be, apart from lots of talking about Spring of course! ...

How to know which URLs are mapped in the current servlet context in a Spring 2.0 Controller method?

In Spring 2.0, is there a quick way to have a list of the current servlet context's mapped URLs from inside a Controller method? I'm writing a method called getMappedUrls(), and the purpose of this method is to show what urls are mapped in the current servlet context. This method is to be used to generate an small online doc of availab...

How can I get the ServletRequest object from within an XFire AbstractHandler's invoke() method?

I'm using XFire as the Web Services provider for Spring Remoting. I'm using an AbstractHandler to authenticate the SOAP request. The idea is to identify the request by the originating server's domain and an API key (a-la Google Maps). The only problem is that I can't seem to find a way to fetch the ServletRequest object from within the i...

Annotating inherited properties for persistence

Assuming I have a class A as follows: class A{ int id; int getId(){}; void setId(int id){}; } And a class B as follows: @Entity @Table(name="B") class B extends A{ string name; @Column(length=20) string getName(){} void setName(){} } How can I annotate the inherited id field from A so that Hibernate/JPA knows ...

How to create hyperlink in Spring + JSP

What's the proper way to create a hyperlink in Spring+JSP? There must be a better way than just coding in the <a href="..."> tag. Take for example a page that displays people. The URL is people.htm. The corresponding controller gets people from the database and performs optional column sorting. The JSP might look like: <table> <tr> <t...

Spring AOP: applying properties through the aspect

The intent here is to deal with obfuscated passwords for resources. We have an Advisor that intercepts calls to setPassword and decrypts the argument. We've set up a template that looks somewhat like this: <bean id="pwAdvisor" class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor"> <property name="advice"><bean clas...

Spring and Hibernate, Lazy initiation problem

Hey I am developing an desktop application using Spring and Hibernate, and I have a problem with lazy initiation. I looked in the web and every solution is related to the open session in view pattern, but I can't use this pattern. I've also tried to get the sessionfactory from the HibernateTemplate, but it returns to me a disconnected se...

No Such Method Error when creating JUnit test

I've tried figuring out this problem for the last 2 days with no luck. I'm simply trying to create an annotation based JUnit test using the spring framework along with hibernate. My IDE is netbeans 6.5 and I'm using hibernate 3, spring 2.5.5 and JUnit 4.4. Here's the error I'm getting: Testcase: testFindContacts(com.mycontacts.data.d...

How to wire Interdependent beans in Spring?

I want to declare two beans and instantiate them using Spring dependency injection? <bean id="sessionFactory" class="SessionFactoryImpl"> <property name="entityInterceptor" ref="entityInterceptor"/> </bean> <bean id="entityInterceptor" class="EntityInterceptorImpl"> <property name="sessionFactory" ref="sessionFactory"/> </bean> But...

Is there tooling to visualize a live Spring application context?

Are there any tools that can take a fully-constructed/wired Spring application context and export a visualization of it? I'm talking about a live context that shows the order in which aspects were applied, what beans were auto-wired into other beans, etc. I know it can be done with the context files themselves (re: Spring IDE). However,...

auto-detecting components using spring annotations

I've managed to configure to spring to auto-detect my components using the @Autowire annotation. However the problem is that not all the components are being Auto wired. Specifically My DAO's are being bound but my service objects aren't. I have to explicitly create a bean for my service object in the spring xml config file. Any clu...

Is it safe to assume that Spring MessageSource implementations are thread-safe?

Is it safe to assume that all implementations of org.springframework.context.MessageSource interface are thread-safe after initialization? I would expect that it's safe, but now I'm looking through Spring source code, and there's org.springframework.context.support.ReloadableResourceBundleMessageSource which reloads properties from time...

Spring context files organization and best practices

We have started using Spring framework in my project. After becoming acquainted with the basic features (IoC) we have started using spring aop and spring security as well. The problem is that we now have more than 8 different context files and I feel we didn't give enough thought for the organization of those files and their roles. New ...

Grails, Inserting lots of data using withTransaction results in OutOfMemoryError

I'm using Grails 1.1 beta2. I need to import a large amount of data into my Grails application. If I repeatedly instantiate a grails domain class and then save it, the performance is unacceptably slow. Take for example importing people from a phone book: for (each person in legacy phone book) { // Construct new Grails domain class f...