spring

How to test Internet Explorer when using RequestHeaderAuthenticationFilter ?

We're using Spring Security with RequestHeaderAuthenticationFilter, and thus relying on a HTTP header to be set for the user name. On our local machines we don't have the software for authenticating, and thus not the header. When testing with WebDriver or FireFox we can set the header and test correctly, but when manually testing with I...

How do i use HibernateTemplate.findByNamedParam() ??

HI, i am trying to use the above spring hibernate temnplate method do a simple query based on a specific ID from the database but the problem is that the query doesnt replace the ":" character from the sql string below into the value contained in "id". i thought that this method replaces ":" with the given parameter i set in the method ...

how to read spring beans definitions

I need to read the bean definitions from a Spring context file, practically reading what is inside the XML. I do not want to instantiate beans, I just want to read the content of the file. While I can write a parser to do so, I imagine Spring already does this. What classes does it use (I am running around the XmlBeanDefinitionReader re...

Swing GUI Development with Spring

Are there any decent tutorials out there for building Swing GUI applications using Spring (v3 preferably)? ...

Springs SimpleUrlHandlerMapping not mapping my controller

Hi therem I've got the following mapping <!-- URL Mapping --> <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/computing">computingController</prop> <prop key="/computing/login">computing...

Detect session timeout in Spring 3/Spring Security 2.0.5

I have a web application running under Spring 3 with SpringSecurity 2.0.5. To present the user the changes to the site since his last visit, I try to register the time when his session is destroyed. Therefore I registered org.springframework.context.ApplicationListener<HttpSessionDestroyedEvent> and also a javax.servlet.http.HttpSessionL...

Law of Demeter and DAO pattern

Here's a method in my Spring/Hibernate website's code that exemplifies my codebase: public class UserVoteServiceImpl implements UserVoteService { @Autowired UserRepository userRepository; public static int getUserScore(long userId) { return userRepository.findUserById(userId).getScore(); } } I believe that this method...

Using Spring XML, create a JAX-WS Client without a serviceClass

I know it is possible to create a jaxws:endpoint without the SEI, so long as you have the wdslURL, serviceName & endpointName, address. I see lots of examples about wsdl2java, and then using that class value as the serviceClass attr. And lots of Java based examples, I am more interested in spring based XML. For example, here is what I...

spring validation with @Valid

hi, I'm validating incoming attribute, but the validator catches even the other pages not annotated with @Valid @RequestMapping(value = "/showMatches.spr", method = RequestMethod.GET) public ModelAndView showMatchPage(@ModelAttribute IdCommand idCommand) //etc When I access page /showMatches.spr I get the error org.springframewo...

Tomcat 6.x web.xml default and custom servlet routing

I have two servlets defined in the web.xml file, namely the default2 and myservlet. The default2 servlet is used to map the static files like the javascript and css. The myservlet is used for getting dynamic content. <servlet> <servlet-name>default2</servlet-name> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servl...

Spring security 3.0.3 configuration error.

I'm trying to implement spring-security to handle authentication and authorization of my web application. I can't get the configuration right. Tomcat trows an error when I deploy the war file. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authentication.ProviderMana...

Cannot autowire child bean (defined in a web context) from root context

I have a bean in the root context (ApplicationContext) which autowires another bean in a WebContext and it's throwing: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pa...

Setting Up Annotation Driven Transactions in Spring in @Configuration Class

So in the latest version of Spring we are able to use the @Configuration annotation to setup our configurations for Spring. Now in JavaConfig it is possible to use the @AnnotationDrivenTx (@AnnotationDrivenTx Reference Link) annotation to setup transactions in our Config class. But since JavaConfig has been decommissioned I was wondering...

Spring security as applied to Flex AMF channels?

The Spring/BlazeDS documentation is not clear on what happens if you just put <flex:secured /> Within the <flex:message-broker> stanza. That is, do not put any of these in there: <flex:secured-channel channel="my-amf" /> What happens? Will all channels be secured by default? or no channels? Piggyback question: Even if you put i...

<tx:annotation-driven /> leads to java.lang.ClassNotFoundException: org.aopalliance.aop.Advice

Anybody has an idea why adding the annotation-driven declaration leads to the aopalliance classes not found. I have not explicitly defined the weaving so using Spring defaults. Any help is appreciated ...

i am getting java.net.ConnectException: Connection timed out exception in IE 7 but not in IE 8

Hi, If i use IE7 to access my application & do some save or delete operations i am getting "java.net.ConnectException" but if i use IE 8, application is going smoothly. using of IE 7 is mandatory for the users i have no other go now. Please guide me to solve the problem. Quick answers would be deeply appreciated. Thank You, Pruthvi ...

Tomcat errors, reasons JAR not included in build

When I try to deploy my Spring application to Tomcat, it gives me errors (localhost-{date}.log) saying I'm missing commons-pool-{version}.jar. However, the source code is part of a STABLE release. I'm using maven to build and I've successfully built and deployed this project successfully (earlier today, in fact). So something must ha...

How to make Spring Lifecycle callbacks work in web applications?

I have a web application set up like this: Embedded Jetty instance is started from Main with DispatcherServlet with name "myservlet" inside it. File myservlet-servlet.xml exists in resourceBase of that servlet. It contains only these lines: <context:component-scan base-package="com.mycompany.myapp.config.spring" /> <context:component-...

How does dependency injection work?

I want to know how spring does dependency injection. I want the low level logic used. Updates: I want to know how the object references are injected to the constructors or setter methods, is it through Reflection or some byte code level. Updates: i got the answer elsewhere , the answer is bytecode instrumentation. ...

Joomla CMS and Spring Framework

I want to create a Web application by combining Joomla CMS with Spring Framework. What would be the best way to build/use a single sign-on for both?. All the pages on the website will be serviced by Joomla CMS, but those that require authentication/authorization will be done with Spring Framework. The later will retrieve widgets from Joo...