spring

spring security quick start

I am trying to follow this to incorporate spring security in the framework http://java.dzone.com/tips/pathway-acegi-spring-security- i hope to make a basic form based authentication, so i think this would be a great pointer. if i am using the spring security 3 libraries, would there be any different? which file is the authentication-...

To which part should I add Spring

I'm building a simple web application that handles a simple database using struts and hibernate (so far the application works just fine with these two frameworks), Now I want to add Spring to this application. I have some basic knowledge of how Spring works, but I don't know to which part I need to add Spring's capabilities. Application...

download spring with dependencies

hi there, is there a way to get a spring-with-dependencies.zip for the latest version of spring (3.0x) ? I know that one could get whatever dependencies using maven/ivy but if I were NOT to use either of these tools, AND also without knowing which library versions are compatible, how can I get all the JARs one-shot ? Just like CentOS ...

Exporting Spring @Bean objects using JMX

I'm using Spring's @Configuration, and I noticed that a @Bean does not get registered using JMX. The bean is wired as @Bean protected CountingHttpInterceptor countingHttpInterceptor() { return new CountingHttpInterceptor(); } and the class definition is @ManagedResource public class CountingHttpInterceptor implements HttpReque...

Autowire throws a NullPointerException.

Hi, I am new to Spring. I have following class where i am using autowire annotation package com.almas; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import org.springframework.test....

spring jdbc and composite primary keys

Hi Is there a way in spring jdbc to return a composite primary key when a row is inserted. This composite primary key is made up of values from separate sequences Any help is greatly appreciated Regards Damien ...

How to use Fast Bind to connect Ldap with Spring

Hello, I managed to connect to an ldap server using spring. I want to create an anonymous session and use fast bind for authentications. I'm not sure which properties I need to change to use fast bind ? (sample code will be great!) Thanks in advance! ...

Using ContextLoaderListener to attach parent ApplicationContext to Grails ApplicationContext does not work in Integration Tests

Using ContextLoaderListener to attach parent ApplicationContext to Grails ApplicationContext does not work in Integration Tests To make our grails application work with the rest of our existing spring application, we followed the advice in http://grails.1312388.n4.nabble.com/Grails-and-existing-Spring-web-app-integration-issues-td133936...

How to create two instances of the same spring controller, each with a different base @requestMapping

I have a spring controller (MyController) which servers data as json. With a few configuration changes, I will be able to reuse the same controller and have it serve the same data, but as xml, not json. I'd love to be able to create myControllerInstanceA, and configure it to use /json as a base url, then create myControllerInstanceB an...

Creating your own custom helpers with Freemarker?

From my controller I set my Model and view like: ModelAndView mav = new ModelAndView(); mav.setView("index"); mav.addObject("user", user); mav.addObject("someCollection", someCollection); return mav; Now I want to create a helper type object that will take the someCollection and the user object as parameters. My helper function wi...

How to enable HTTP digest for embedded jetty / spring security?

I have two small http servers. One using the sun (com.sun.net.httpserver) server and one using an embedded jetty. Now I'm trying to get HTTP digest working on at least the jetty server (well, that was one of the reasons to use jetty instead of sun httpserver). Regardless of which server I utilize the basic setup is done via spring IOC co...

Freemarker with spring mvc, so what will my action look like?

In my appname-servlet.xml I have: <!-- freemarker config --> <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer"> <property name="templateLoaderPath" value="/WEB-INF/freemarker/"/> </bean> <!-- View resolvers can also be configured with ResourceBundles or XML files. If you need...

removing commons-logging and using slf4j causes errors in spring

Specifically, I use spring only for configuring my project through ApplicationContext. In my spring xml I load some bean properties through PropertyPlaceholderConfigurer. Whenever in the dependencies I swap commons-logging-x.x with jcl-slf4j.jar the loading of the context fails with ClassNotFoundExceptions on the placeholder substitution...

using AbstractTransactionalDataSourceSpringContextTests with Hibernate & DbUnit - inserted data not found

All, I'm attempting to write a unit test for a Dao that uses Hibernate. I'm also using Spring, so I'm trying to extend AbstractTransactionalDataSourceSpringContextTests and also use DBUnit to insert data into the database before each test in the onSetUpInTransaction method. From my logs, I can see that DbUnit is able to successfull...

Recommended way to access Spring beans in Apache Tomcat webapp?

I'm developing a web application on Apache Tomcat 6 with Hibernate and Spring, I'm using different XML configuration files to define my Spring beans (like the Hibernate DAO, Quartz scheduler and some other stuff). All these files are loaded at Tomcat start up via web.xml (ContextLoaderListener). Now I'm not sure what is the recommended ...

spring security direct user from any page to login

which object in the application context i should use to direct user from / to the login page? <http use-expressions="true"> <intercept-url pattern="/" access="permitAll" /> <intercept-url pattern="/login/**" filters="none" /> <intercept-url pattern="/static/**" filters="none" /> <intercept-url pattern="/**" access="isAuthenticat...

Cannot send email from localhost using spring mail ?

greetings all i am suing spring mail to send emails from localhost using postfix but it's not sending and i got no excpetions maybe there's an error in the configuration, i don't know 1-the method: public void sendEmailMimeType(final String subject, final String mailTo, final String templateName, final Map<String, Object> model) { ...

Spring Roo MVC view engine

Hi, At first I would like to know who use spring-roo framework? At second I would like to know is it possible to change default view engine of spring-roo. Spring claims that roo is absolutely new productive framework (some kind of mix with productivity abomination - SpringMVC and big, performances-poor dinosaurs - Grails). By default ...

Eclipse 3.5 Cache Problem

Hi, I am using eclipse 3.5 with google app engine + spring framework to develop application. My problem is when I change the code and build the project, the new code doesn't come in to effect. I even deleted the old file but at runtime, the old version gets display in the browser. Why? ...

Logging successful / unsuccessful Spring context initialization

Hi there, I need to log whether the Spring context was initialized correctly in a log file. If all the beans were wired and loaded correctly, I need to log that, as well as an incorrect initialization... I have created the appender and the log file, but the problem is that I don't know if there is something in Spring to log those two ...