spring

Spring 3.0 HEAD Requests

Hi recently we moved to spring 3.0 Controller handling like this: @Controller public class MyController { @RequestMapping(method = RequestMethod.POST) protected String onSubmit ( Form form, Errors errors) { // handle POST } @RequestMapping(method = RequestMethod.GET) protected void getForm ( Form form ) { ...

Validate input field to display another input field on the same page

Hello using spring 3.0 I have page on web flow which has a password input field once the user finishes entering password i need to validate the password if it is right then display email id input field on the same page. How can i achieve this in flow? Thanks ...

Webservices with Maven, Spring and Hibernate

I am developing an application using Hibernate, Spring and JaxWS. I was using JaxWS 2.1 and everything was running smoothly .. I need to upgrade to JaxWS 2.2 so I could use the @XmlElement annotation to require a parameter @XmlElement(required=true) .. So I updated my pom file <!-- <dependency> <groupId>com.sun.xml.ws</g...

Spring MVC 3 JSTL will not output values in Tomcat 5.5

I'm having difficulty showing the model values from my controller to my JSP view. Everything works in Tomcat 6. But it doesn't work in Tomcat 5.5. Here are my files. web.xml for Tomcat 5.5 (For Tomcat 6, I use version="2.5" and the correct schema) <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" ...

a spring bean to wrap salesforce web service calls

I am trying to figure out how to create a stateless spring bean that wraps a group of calls to salesforce web service API. My understanding is that the process for calling salesforce is something like this: Call the login service to Log into salesforce Make a series of service calls Call the logout To have a stateless wrapper it see...

Is it necessary to close JAX-WS port?

In some tutorials (e.g. here, here and here) it is suggested to close the JAX-WS port by casting it to com.sun.xml.ws.Closeable e.g. MyPortType port = MyService.getMyPort(); ... do some operations on WS proxy ... ((com.sun.xml.ws.Closeable) port).close(); This approach will not work for proxies, returned by JaxWsPortProxyFactoryBean, ...

injecting derived property for @Repository bean without @Autowired in super class

I would like to use @Repository spring annotation to avoid adding bean in context.xml. I use ibatis integration, so my repository class looks like this @Repository("userDao") public class UserDaoMybatis extends SqlMapClientDaoSupport implements UserDao { // ... } SqlMapClientDaoSupport (spring library class) has final method for s...

Spring MVC ebook

Could anyone suggest a good ebook for spring 3 mvc and osgi? thx ...

Can I dynamically create a List by scanning the beans in a spring configuration file?

For example, I have created a slew of 'test-my-service' Objects in my Spring config and each Object has data that concerns a contrived test scenario. Currently I am manually editing the Spring config every time I want to run a new scenario, or a List of scenarios. Is there a way I could add a prefix to a bean name, and then load all of t...

How to manage database settings from within a Spring MVC web application?

I have been working with Spring Framework 3.0 for the last couple weeks and have been really impressed. This is my first project with Java. My main problem is that I can't find a way to let the end user manage their own database connection from within the web application. The project I am working on will be installed on the client's comp...

Send Email or Logged Error on 404 and 500 Http Error Spring MVC

I have been thinking, how is it possible for me to send an email when a particular HTTP Error code happens in my Spring MVC Web app. Please take a look at my web.xml configuration. It works fine and redirects me to the particular error page. <web-app ...> <servlet> <servlet-name>mvc-dispatcher</servlet-name> <servlet-...

[ Jboss5.0 ] - No JTA UserTransaction available - specify either 'userTransaction' or 'userTransactionName'

Hello everyone, I have encountered a strange problem with spring transaction. My application uses Spring with EJBs. The EJBs also invoke Spring service classes annotated with @Transaction. I have used Spring JtaTransactionManager for transaction management. The application is packaged as an EAR file and is deployed on jboss5.0 and it w...

JSTL & Spring: Accessing methods in conditionals

I have an object with a method public boolean hasPermission(String role) { return permissions.contains(role); } I want to do the equivalent of: <c:if test="${row.hasPermission(role)}"> <td></td> </c:if> But I cannot access the hasPermission method from within the JSP file. How can I do it? ...

Auto login after successful registeration

hey all i want to make an auto login after successful registration in spring meaning: i have a protected page which requires login to access them and i want after registration to skip the login page and make an auto login so the user can see that protected page, got me ? i am using spring 3.0 , spring security 3.0.2 how to do so ? ...

@PostConstruct Annotation and JSF

Hello; I have a problem on my project implemented on JSF 1.2 (MyFaces 1.2.6) and integrated Spring. The problem is about @PostConstruct annotation. It is executed but I see that it is executed before managed properties are populated. First I suspect about managed properties taken from Spring context so I tried a simple integer manage...

How to inject dependencies into a self-instantiated object in Spring?

Let's say we have a class: public class MyClass { @Autowired private AnotherBean anotherBean; } Then we created an object of this class (or some other framework have created the instance of this class). MyClass obj = new MyClass(); Is it possible to still inject the dependencies? Something like: applicationContext.injectDepend...

Problem with annotation spring context with differ modules.

Greeteng. I made application based on spring annotation configuration. This application is moduled, i'm build it with maven. I scan application to find Configurations in one module. public class ClientUserDAOImplTest { private static UserDAOLocal userDAOLocal; @BeforeClass public static void start() { beginDate = new Date(); ...

Maven 3 has a new DSL formats for its POM. Is there a similar sort of format for Spring applicationcontext.xml files?

In Maven 3 there are new DSL replacements for the POMs. See: http://polyglot.sonatype.org/groovy.html for the wonderfully terse syntax. Is there something similar that can be used for Spring applicationcontext.xml files? ...

<context:property-placeholder> variables not accessible to the child (web) context

A typical use-case: I'm having applicationContext.xml and dispatcher-servlet.xml. In the parent context (applicationContext.xml) I have: <context:property-placeholder location="classpath:application.properties" /> However, the variables loaded by it are not accessible to the web context - neither in xml, nor using @Value. (They are j...

how to create a Spring bean from a static inner class constructor?

I am trying to use the Spring Framework IoC Container to create an instance of class ThreadPoolExecutor.CallerRunsPolicy. In Java, I'd do it this way... import java.util.concurrent.RejectedExecutionHandler; import java.util.concurrent.ThreadPoolExecutor; ... RejectedExecutionHandler rejectedExecutionHandler = new ThreadPoolExecutor.Cal...