spring

Is it possible to run MyFaces as OSGi Bundle with Equinox?

Hi all, i try to run JSF (MyFaces) Application as OSGi Bundle (Spring DM and Equinox).Is it possible at all? Are there any web resources with some examples? Thanx in advance ...

Spring Dependency Injection..

Hi All, I am quite new to Spring DI. We have two classes, PhysicalService and PhysicalDAO. Physical service instance is being created dynamically using some service handler, hence it is not spring managed bean. Physical DAO instance is managed by Spring Beans. Is there any way by which I can inject physical dao in physical service? ...

Is it possible to Autowire the JDO PersistenceManager or only the PersistenceManagerFactory?

Is it possible to Autowire the JDO PersistenceManager? In the example below, only the PersistenceManagerFactory is Autowired, while the PersistenceManager is obtained using a getter and utility method before each operation. import org.springframework.orm.jdo.PersistenceManagerFactoryUtils; @Service public class MainServiceImpl impleme...

Not able to run basic spring mvc example -- resource not found

web.xml <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spitter-servlet.xml</param-value> </context-param> <servlet> <servlet-name>spitter</servlet-name> <servlet-class>...

JSF 2.0 Application as Spring Web Bundle

Hi all, is it possible to run JSF 2.0 Application as Spring Web Bundle? Is there any OSGi support for JSF 2.0? I didn't found any OSGified bundles for Apache MyFaces 2.0. Thanx in advance ...

packages for spring framework

Hi I am new to spring framework. I am practicing spring example in Eclipse IDE, I like to know what all plugins I need to install to get started with spring framework. Thanks in advance... ...

Is there a good reason why Spring Roo puts database.properties in META-INF/spring?

I'm trying to understand the reasoning behind why Spring Roo places database.properties in META-INF/spring, where it will be deployed as part of the WAR. Surely database properties are environment specific and should be outside a WAR where they can be changed without rebuilding? I'm about to change the line in application-context.xml t...

Tomcat serving static resources on Spring MVC app

Hello all, I'm building a Spring MVC application, and the frontController servlet is mapped in "/" intercepting all requests, I'd to be able to serve the static contents (.js,.css,.png...) from tomcat and not by Spring. My app structure is -webapp/ styles/ images/ WEB-INF/ views/ By default, because the frontContr...

How to pass a HashMap of properties to an Autowired bean in Spring?

Instead of instantiating a PersistenceManagerFactory within my app like this: Properties properties = new Properties(); properties.setProperty("javax.jdo.PersistenceManagerFactoryClass", "org.datanucleus.jdo.JDOPersistenceManagerFactory"); properties.setProperty("javax.jdo.option.ConnectionDriverName","com.mysql.jdbc.Dri...

Simple Spring <remember-me/> ... help please

All I want, is a simple remember-me. I read http://static.springsource.org/spring-security/site/docs/3.0.x/reference/remember-me.html What I have done so far: Created my own UserDetailsService to work with Hibernate / JPA. My impl. does not consider any remember-me stuff Considered configuration through appContext <security:remember-m...

Can we change DispatcherServlet context configuration file name?

In Spring web mvc 1) If we define DispatcherServlet as below <servlet> <servlet-name>appServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> </servlet> it looks for file named appServlet-servlet.xml under WEB-INF folder as mentioned in the spring reference. My question is ca...

Where is the @Autowired annotation supposed to go - on the property or the method?

Which is more correct? This (with the @Autowired annotation on the method)? @Controller public class MyController { private MyDao myDao; @Autowired public MyController(MyDao myDao) { this.myDao = myDao; } This (with the @Autowired annotation on the property)? @Controller public class MyController { @...

Configure Springs MappingJacksonHttpMessageConverter

Hi there, I am using MappingJacksonHttpMessageConverter in spring mvc to automatically serialize objects like this: @RequestMapping(value="/*/getAccount", method=RequestMethod.GET) @ResponseBody public Account getAccountAction() { Account account = accountService.getAccount(); return account; } Is it p...

How to inject a spring's service bean into a JPA Entity ?

My problem is very similar to this one : Injecting fields via Spring into entities loaded by Hibernate The difference is that , I am using JPA2 entities , not hibernate . While the underlayer is still hibernate (3.5.5). My spring version is 3.0.4. What's the corresponding eventListeners in JPA's world ? Sample code from the original ...

Problem with Spring FileUpload

I have the following block of code which is handling my file upload of a photo that I am using in my Spring MVC web application. I am using Spring MVC CommonsMultipartFileResolver to handle file uploads. if(model.getPhoto() != null){ if(!model.getPhoto().isEmpty()){ MultipartFile file = model.getPhoto(); String fileN...

AspectJ with Spring misses something

Hi all! I'm just playing with AspectJ (1.6) with Spring (2.5), but it seems not to work in the proper way. I set up my "beans.xml" using: <aop:aspectj-autoproxy/> <bean id="testBean1" class="apackage.MyClass"> <bean id="aopBean1" class="apackage.AfterReturningExample"/> with the correct namespaces set and some other beans with no impo...

Jersey: Inject Spring component into ContainerRequestFilter

I am using Jersey 1.4 ea together with Spring 3.0 and the jersey-spring integration. Integrating Jersey and Spring works fine for resource classes as described here. How ever I want to inject a spring component into a ContainerRequestFilter to do some pre-processing of requests. @Component public class SecurityFilter implements Contai...

How to set the fields of an object given a map of key/values;

I want to implement something similar to the JobDetailBean in spring http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/scheduling.html#scheduling-quartz-jobdetail where a map of properties can be applied to an object to set its fields. I looked through the spring source code but couldn't see how they do ...

Logging Entity changes in Java Web Application

Hi, We have a requirement on our project, where we need to maintain a sort of history of changes that are made to certain Entities in the Application. The the Application is a Java Web App based on Struts, Spring and Hibernate. What sort of approaches have been used in this case ? Triggers on the respective tables is one idea but the...

What's this Spring error and how to fix it

Sep 17, 2010 3:32:50 PM com.springsource.tcserver.security.PropertyDecoder <init> INFO: tcServer property decoder has been initialized. Sep 17, 2010 3:32:51 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:t...