spring

Spring Security Method Level Security inside HTTP application

I've got HTTP Security working in my web application with CAS authentication using Spring Security. However, I'm trying to mix it with method level security for some service methods (specifically GWT RPC), but it doesn't seem to be working. It gets to the point where it executes the @PostAuthorize annotation. However, it doesn't seem to ...

How to have Eclipse Scala-IDE + Spring-IDE plugins working together?

According to http://www.assembla.com/wiki/show/scala-ide/Troubleshooting in order to have the Scala Eclipse plugin to work with eclipse 3.5 you must desintall your Spring-IDE pluging since the latter deactive the JDT Weaving. I had to do so. Do you know any effective way to circumvent this, I'm an active Spring developer, for obvious re...

How to create a default method in SpringMVC using annotations?

I can't find a solution to this, and it's driving me crazy. I have @Controller mapped that responds to several methods using @RequestMapping. I'd like to tag one of those methods as default when nothing more specific is specified. For example: @Controller @RequestMapping("/user/*") public class UserController { @RequestMapping("l...

Spring Security and Multitenancy / REST -> How? Best practice? Reference app?

Hi all I have been looking for a way to secure URLs like @RequestMapping("/owners/{ownerId}/pets/new") on user (not role) level, i.e. only owner with ID {ownerId} has access. Moreover, I want to secure RESTful design incl. async access to JSON services on owner level dynamically. My questions: How is this best done with Spring Se...

@Bean inside class with @Configuration and witout it

There is a @Bean annotation in Spring 3.0. It allows to define a Spring bean directly in a Java code. While browsing Spring reference I found two different ways of using this annotation - inside class annotated with @Configuration and inside class which doesn't have this annotation. This section contains following piece of code: @Compo...

Hibernate getHibernateTemplate issue when saving object inside another object

I recently changed my code to make reference to the getHibernateTemplate(), and now my forms don't seem to save correctly, here's the code: public void saveForm(EcoFormFill form, int userId) throws RemoteException { User tmpUser = (User)getHibernateTemplate().load(User.class, new Integer(userId)); form.setUser(tmpUser); ...

How to use @requestMapping headers?

I studying springmvc,When I use @RequestMapping(value="/helloWorld", headers = "content-type=text/*"),I input http://localhost:8080/SpringMVC_10100/helloWorld ,I found console is WARN org.springframework.web.servlet.PageNotFound - No matching handler method found for servlet request: path '/helloWorld', method 'GET', paramet...

Spring Configuration Settings For Neo4j

Hi I would like to integrate the "neo4j_config.props" file from http://wiki.neo4j.org/content/Configuration_Settings#Optimizing_for_traversals_example into the : a neo4j spring app, the graphDbService which is configured the in app-config.xml: <bean id="graphDbService" class="org.neo4j.kernel.EmbeddedGraphDatabase" init-method="en...

J2EE Struts,Spring and Hibernate Framework problem

i am going to develop a web application using Struts,Spring and Hibernate. But i have no idea about any of them. Even i know little about JSP and nothing about Servlet. So my question is what to do? I have to learn all those things. But i don't have much time. Normally to learn something i read books on that topics or use tutorials. Now ...

Multiple transaction managers with @Transactional annotation

We have base generic manager which is inherited by all managers. Base manager is annotated with @Transactional annotations. There are 2 groups of transactional services: x.y.service1.* - have to be managed by transactionManager1 x.y.service2.* - have to be managed by transactionManager2 How can transactions be configured without...

Jaxb2Marshaller creating JAXBContext with empty namespace URI

Using Spring 3, I have created a MarshallingView, with the following marshaller: <bean name="xmlMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r"> <property name="classesToBeBound"> <list> <value>com.mydomain.xml.schema.Products</value> </list> </property> <property name="marshalle...

Why SpringMVC Request method 'GET' not supported ?

I trying @RequestMapping(value = "/test", method = RequestMethod.POST) but is error Code is @Controller public class HelloWordController { private Logger logger = LoggerFactory.getLogger(HelloWordController.class); @RequestMapping(value = "/test", method = RequestMethod.POST) public String welcome() { logger.info("Spring param...

bean reference with two Spring config context XML files

I always get it worked when reference to a bean in an other Spring context XML file but this time is doesn't work: springapp-servlet.xml: <!-- Spring Controllers --> <b:bean id="loginSpringController" class="com.foo.bar.controllers.spring.LoginController"/> <b:alias name="loginSpringController" alias="loginSprController"/> applic...

What is Dependency Injection ?

Possible Duplicate: What is dependency injection? Spring is the framework from where the concept Dependency Injection came to picture. What is purpose of DI ? How does it benefit ? How is it implemented ? ...

How to display the same data on all pages in Spring Framework 3.0?

I have some text data from database that I want to display it on all pages on my site. (for example news block etc.) How can I load and pass it to View in Spring Framework 3.0? I don't want to create some method, which will retrieve data, and call it from each controller... ...

How can I set the 'runas' userid for an MDP?

I'm using a DefaultMessageListenerContainer to consume a JMS message and then invoke a bean that extracts the user-id from SecurityContextHolder.getContext().getAuthentication().getPrincipal() before inserting a record into the database. The user-id is null as you would expect because there is no authenticated principal. Is there a n...

Yet another "unable to locate Spring NamespaceHandler" error

I'm creating a stand-alone Sava application with Spring, to handle the JDBC access. The application works fine on every test and I decided that I need a jar to be deployed our clients. They might not have spring in their classpath, so I used maven-assembly-plugin to handle the jar creation with dependencies. However when I try to run t...

Spring AOP injecting PortletRequest

Hi there, I'm trying to inject a portletrequest in my aspect class @Autowired(required = true) private PortletRequest request; @Before("execution(* de.ac.mis.dao.*.getSessionFactory())") public void setUsername() { System.out.println("Now I'm setting the username " + this.request); } Only gives me an Caused by: org.springframew...

Spring Security Custom Filter (Change Password)

Hi, I'm using Spring Security for securing HTTP requests to a website. The primary usage is for securing pages such that the user is redirected to the login page when trying to access those pages. However, I have a further requirement. In my model, I can flag a user's password as being temporary such that, when they successfully login,...

Limiting Dependency on Spring Without Losing Power of Framework

Simplified Architecture of Web Projects WAR spring dependency injection (most use XML) JAR DAO Domain The Problem: With Spring 3 and 2.5+ annotations building Repositories and services has become much easier to wire together. However, because often a @Service conceptually belongs in the JAR far mo...