spring

Vaadin and Spring MVC Integration

I'm thinking about the possibility of using Spring MVC with Vaadin Framework. Are there any documented ways of making them play nicely together ? Also is it a good idea to use them together ? relating to performance; I'm going to run the app on a dedicated server. To make my question a bit more clear, how can i return a modelandview fr...

binding to a Set in Spring

If I have a list object I know that I can bind class property fields to form using the code below. <c:forEach items="${items}" var="i" varStatus="itemsRow"> <input name="items[${itemsRow.index}].fieldName" type="text"/> </c:forEach> <form:errors path="items" /> What do I do if the property is a Set object. I have read about initBin...

error handling with spring + servlet spec

I have a web-app (2.5 servlet spec) with a spring dispatcherservlet handling anything coming on /error/* and an error page configured to route that to /error/ something like this: <servlet> <servlet-name>errorServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-star...

Quartz JobStore with Spring Framework

Hi all, I am implementing Quartz Job Store on Oracle DB using Spring Framework. My ApplicationContext.xml is below <bean id="driverJob" class="org.springframework.scheduling.quartz.JobDetailBean"> <property name="jobClass" value="BatchFileCollector" /> </bean> <bean id="ranchTrigger" class="org.springframework.scheduling.quartz.Simple...

Application Configuration (Spring?)

Hi Stackoverflow! im getting tierd of all this boring boilerplate code to parse application configuration like database connections, working directories, API endpoints and whatnot. Sping IoC looks nice, but this will force the user of my application to modify the XML file just to edit the database URL and so on. This might also be very ...

Spring MVC or Grails?

I'm new to the web programming world, and I'm trying to learn about various Java MVC frameworks available. Through my research, I came across Spring MVC and Grails. My question is: which one is better for developing enterprise web applications, or is there another option I haven't run across yet? Important considerations: Must be su...

How do you load a bean into Spring MVC's application context?

As I understand it, Spring MVC application has two distinct contexts, the application context and the web context, which are controlled by applicationContext.xml and dispatcher-servlet.xml, respectively. Inside my controllers, how do I go about loading a bean into either of these contexts? Note that I am aware of Getting Spring Applica...

Equinox (OSGi) and JPA/Hibernate - Finding Entities

I am trying to use Hibernate/Spring in an OSGi (Equinox) environment. It works great if I explicitly point it to the Entity classes in the Persistence.xml: <class>com.es.t.eee.domain.StuffSource</class> <class>com.es.t.eee.domain.PostalAddress</class> What I want is for Hibernate to "find" all of the Entity classes just as it does ...

What is the easiest / most transparent way of caching methods in spring?

If I have a bunch of DAO's with a bunch of getXXX methods and I want all or some explicit list of the methods cached is there any way I can do this transparently with Spring? What I don't want is: To change any source code / add anotations Manually have to create a number of proxy beans for a number of DAO's and rewire them all. Ide...

Spring Wire a Static Class

I'm dealing with a legacy code base where a class which is not wired up in spring needs to obtain a class that is wired up in spring. I was hoping to create a factory class that was wired up on startup and then I could just call the getInstance() method to obtain a wired up object. What is the best way to go about this? Example: publ...

Spring: accessing HttpServletRequest in a custom ViewResolver

Hi. I would like to access an HttpServletRequest object of the originating request in a custom InternalResourceViewResolver based resolver. Is there any simple way to do this? I am using Spring 2.5 here. ...

Spring HTTP invoker returns a null proxy, need debugging help

Hey all I've followed the spring http proxying tutorial as closely as possibly, but I still can't get it to work at runtime (my configuration is largely identical, so unless I've missed a typo there is no need to post it). The Client starts up fine, as does the server (and I've verified that the object on the server is instantiated), ...

Where is RequestMapping?

I downloaded spring-framework-2.5.6.SEC01-with-dependencies.zip. There is the RequestMapping javadoc in spring-framework-2.5.6.SEC01\docs\api\org\springframework\web\bind\annotation\ But in the spring-framework-2.5.6.SEC01\dist\spring.jar I can't find the RequestMapping class and the package org.springframework.web.bind. Am I download...

Custom 404 using Spring DispatcherServlet

I've set up web.xml as below. I also have an annotation-based controller, which takes in any URL pattern and then goes to the corresponding jsp (I've set that up in the -servlet.xml). However, If I go to a page that ends in .html (and whose jsp doesn't exist), I don't see the custom 404 page (and see the below error in the log). Any p...

Java Color creation throws IllegalArgumentException when used with integer arguments

The following code when executed on certain machines in our company causes an IllegalArgumentException to be thrown: Color sludge = new Color(133, 133, 78); //throws IAE with message "Color parameter outside of expected range: Red Green Blue" An equivalent call using float arguments instead works: Color sludge = new Color(0.522, 0.52...

Something like EJB wiring in Spring for non EJB's

I've noticed recently that spring can wire up my ejb's for me if I annotate the ejb with @Interceptors(SpringBeanAutowiringInterceptor.class). I've never actually done this so don't know the details. I was wondering, is there a way to get this to work with other kinds of beans, for example, @WebService annotated ones as well. At the mo...

How to get the id of a bean from inside the bean in Spring?

What is the easiest way to retrieve a bean id from inside that bean (in the Java code) without using a BeanPostProcessor to set a field? The only way I can think of is something like this using a BeanPostProcessor: public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { ((MyBean)bean).set...

how to redeploy an application on Jboss within Eclipse ?

Hi there, i'm developing a spring-based application with facelets and Java Server Faces which works on Jboss Application Server. As a development Framework, i'm using Eclipse Ganymede Platform Version: 3.4.2 , which integrates the Web Standard Tools and therefore offers support for different servers, like Jboss 5.0. I'm deploying my a...

Spring's AuthenticationProcessingFilter override

Hi, I'm trying to override AuthenticationProcessingFilter in Spring security. I have done following config in xml: <security:http access-decision-manager-ref="accessDecisionManager" > <security:intercept-url .../> <security:form-login login-page='/signin/' authentication-failure-url="/signin/?login_error" default-target...

jdbcTemplate hangs on long update

I recently switched to Spring Framework instead of manually handling JDBC, and it is mostly a good transition. One program started having strange problems, though: if the database is slow, when calling getJdbcTemplate().update( ... ) it sometimes never returns. After researching a little bit, I switched from Apache DBCP to C3PO, but the...