spring

How to provide server address to the Spring-configured Apache CXF-based web service client?

I'm experimenting with Apache CXF and have a question about the client part. Below is my current Spring configuration of the WS client of some com.example.customerservice.service.CustomerService: <jaxws:client name="com.example.customerservice.service.CustomerServiceClient" serviceName="customer:CustomerServiceService" endpoint...

How to configure Spring Security PasswordComparisonAuthenticator

I can bind to an embedded ldap server on my local machine with the following bean: <b:bean id="secondLdapProvider" class="org.springframework.security.ldap.authentication.LdapAuthenticationProvider"> <b:constructor-arg> <b:bean class="org.springframework.security.ldap.authentication.BindAuthenticator"> <b:constru...

How do I create a Spring 3 + Tiles 2 webapp using REST-ful URLs?

I'm having a heck of a time resolving URLs with Spring 3.0 MVC. I'm just building a HelloWorld to try out how to build a RESTful webapp in Spring, nothing theoretically complicated. All of the examples I've been able to find are based on configurations that pay attention to file extensions ("*.htm" or "*.do"), include an artificial dir...

Constructor versus setter injection

Hi, I'm currently designing an API where I wish to allow configuration via a variety of methods. One method is via an XML configuration schema and another method is through an API that I wish to play nicely with Spring. My XML schema parsing code was previously hidden and therefore the only concern was for it to work but now I wish to ...

Good book suggestions for building enterprise software

Enterprise software are built using technologies/softwares/terminologies/APIs such as EJB, JBoss, Seam, Hibernate(JPA), Maven, Eclipse, Spring, JTS, JMS, JNDI etc. I know there are great books out there for each of these individually, however can someone suggest a book or two that covers all (or most of) these topics in lesser detail and...

spring+hibernate set dont allow save

is there any parameter i can set in hibernate so that temporary not allow persist anything but only allow read only (temporary) ? can i set in applicationcontext.xml? ...

Spring Security: how to implement Brute Force Detection (BFD)?

My web applications security is handled by Spring Security 3.02 but I can't find any out of the box support for Brute Force Detection. I would like to implement some application level BFD protection. For example by storing failed login attempt per user in the database (JPA). The attacked user accounts could then get a lockout period or...

Why would I use Scala/Lift over Java/Spring?

Hi, I know this question is a bit open but I have been looking at Scala/Lift as an alternative to Java/Spring and I am wonder what are the real advantages that Scala/Lift has over it. From my perspective and experience, Java Annotations and Spring really minimizes the amount of coding that you have to do for an application. Does Scala/L...

Tapestry 5 and Spring beans with same interface

I have a problem with Tapestry 5 and Spring integration. Problem occurs if I have a multiple beans that implement the same interface and I try to inject them with @Inject annotation. Of course I got an exception. I found a tutorial that says that in that case I have to use @Service annotation too but now I'm getting org.apache.tapestr...

Safeguard against forgetting to configure transactions in spring

Is there a way to make beans unavailable in spring framework? i would like to ensure that in case a developer forgot to wrap transaction around a service in spring framework, that service should become unavailable at run time. Thank you, ...

TDD with HSQLDB -- removing foreign keys

I'm using HSQLDB for data layer integration testing, which is great. However, I'm finding that my foreign key constraints are getting in the way of my tests. For example, to test a simple select on one table, I have to insert dummy data into five additional tables. This makes me want to throw things. I have JPA annotations throughout...

Maven Spring tests fail when run together, but succeed individually (ehcache closed, IllegalTransactionStateException)

We're using Maven/Surefire and Spring/Hibernate transactional tests for a fairly large web application. There are 138 Test* classes, running a total of 1178 tests. A straightforward "mvn test" will generate 82 errors, the nature of which tend to imply a corrupt application context: Many of these: IllegalTransactionStateException: Pre-b...

What to do with lookup entities selected from drop down select ? How to send them to the service layer.

I am developing a spring mvc based application. I have a simple pojo form object, the problem is that many properties will be taked from drop down lists that are populated from lookup entities, so I return the entity ID to the form object. public NewCarRequestForm { private makeId; // this are selected from a drop down. private...

How to achieve spring injection in oVal validation Framework?

This seems to be a big gap in it's spring integration. Has anybody done this or has successfully integrated Spring and Oval successfully? ...

Is it possible to inject a bean into a spring form bean

I tried to do it 2 different ways, but neither way worked. @Component public class EmailForm{ ... private QuestionDAO questionDAO; ... @Autowired public void setQuestionDAO(QuestionDAO questionDAO) { this.questionDAO = questionDAO; } ... Another way: @Component public class EmailForm implements ApplicationContextAware { ......

Sending multi-part email from Google App Engine using Spring's JavaMailSender fails

It works fine without the multi-part (modified from the example in Spring documentation): final MimeMessagePreparator preparator = new MimeMessagePreparator() { public void prepare(final MimeMessage mimeMessage) throws Exception { final MimeMessageHelper message = new MimeMessageHelper( mimeMessage); ...

What is the single most compelling reason to migrate to Spring 3 from 2.x

Currently working on a Spring 2.5 web application, looks as if the business has at least a 5+ year plan for it's usage. There isn't anything in terms of a technology roadmap in place for the app. ...

Spring MVC for portlets, request lifecycle

Hi All, does anybody know where to get documentation about Spring request lifecycle for portlet App (Spring's annotation based controller? I need to know the order of calling methods by Spring and parameters (request, model, ...) available on each stage of request handling. Main question is: when @ModelAttribute methods are called (I ...

ApplicationContext ctx = new FileSystemXmlApplicationContext error

Hi I am completely new to Java, so sorry if my question may sound a bit stupid. I am following a tutorial on hibernate and i am trying to get the context definition files from the file system. ApplicationContext ctx = new FileSystemXmlApplicationContext( new String[] { "conf/rssWebApplication-services.xml", "conf/rssWe...

How to handle MaxUploadSizeExceededException

Hello, MaxUploadSizeExceededException exception appears when I upload a file whose size exceeds the maximum allowed. I want to show an error message when this exception appears (like a validation error message). How can I handle this exception to do something like this in Spring 3? Thanks. ...