spring-mvc

Meaning and solution for Spring 3 error message? "Using getResponseBodyAsStream instead is recommended"

I'm using Spring 3 and every time I submit a HTML form to a Spring controller I get this message, which I don't understand: org.apache.commons.httpclient.HttpMethodBase getResponseBody WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended. Is there a configuration change...

mvc:annotation-driven Spring mvc 3 and Tuckey URL Filter

hi All, I was using Tuckey url for url re-writing. This is how it looks: rule from / from to /pf/welcome to (changed format to enter into this forum, regular xml tags are used) rule and this is how I have my entitymanager set up in web.xml: OpenEntityManagerInViewFilter /*--> /pf/* FORWA...

Spring 3 bind obscures real values of command object.

I have a controller that allows users to add or edit an entity. I've removed myForm.myEntity.name from myForm but spring still shows it when the spring:bind tag is used. See the example below: The snippet below outputs a value: <spring:bind path="myForm.myEntity.name"> <h1>${status.value}</h1> </spring:bind> The snippet below doesn't...

Why are user input dates losing a day? (But not when run locally?)

First, I hope this is the right place for this question. Because I believe this to be a server configuration problem, I wasn't sure if this should go on serverfault. So we have a spring-mvc webapp running on Tomcat servers and connected to an Oracle database. On one of these pages is a form for the user to fill out where they can enter ...

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...

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...

Pattern matching using decorators

I want to define a specific URL pattern using Sitemesh decorators.xml. I want to define a decorator that matches all URLs ending with "/story/_NUMBER_" to be targetted by the decorator. I tried: <decorator name="customMain" page="customMain.jsp"> <pattern>/story/[0-9]+</pattern> </decorator> But this does not work.. Do regu...

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-...

Spring 3 binds empty form

Hi all, On a view I have 1 form and 1 list with form - both are within single tag. List is bound to ArrayList of beans and related form is used to add objects to that list. There are 2 actions on page: adding to list and saving all data. Now the problem is that if user clicks save then whole form is submitted, bound and validated. The...

Case Sensitive URL mapping in spring 3.0

Looks like the default annotations based handler mapping in spring 3.0 does case insensitive handler matching . Is there a way to make this case sensitive ? ...

Spring MVC: What happens if I start a thread in a controller action?

Hi, in a Spring MVC Controller I would like to start a thread that continues work while my controller sends the response. Will this work with spring-mvc ? Best Reagrds, Heinrich ...

how do you inject a bean into a @Controller class

I'm somewhat new to Spring (using 3.0), so I'm hoping there is a simple answer. If I have a controller that is annotated with @Controller and @RequestMapping and I want to set a property via dependency injection, how do I go about doing that? The controller class doesn't have to appear in the Spring configuration file because it gets p...

Is it possible to Autowire the JDO PersistenceManager or only the PersistenceManagerFactory?

Is it possible to Autowire the JDO PersistenceManager? In the example below, only the PersistenceManagerFactory is Autowired, while the PersistenceManager is obtained using a getter and utility method before each operation. import org.springframework.orm.jdo.PersistenceManagerFactoryUtils; @Service public class MainServiceImpl impleme...

Not able to run basic spring mvc example -- resource not found

web.xml <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spitter-servlet.xml</param-value> </context-param> <servlet> <servlet-name>spitter</servlet-name> <servlet-class>...

How to pass a HashMap of properties to an Autowired bean in Spring?

Instead of instantiating a PersistenceManagerFactory within my app like this: Properties properties = new Properties(); properties.setProperty("javax.jdo.PersistenceManagerFactoryClass", "org.datanucleus.jdo.JDOPersistenceManagerFactory"); properties.setProperty("javax.jdo.option.ConnectionDriverName","com.mysql.jdbc.Dri...

Simple Spring <remember-me/> ... help please

All I want, is a simple remember-me. I read http://static.springsource.org/spring-security/site/docs/3.0.x/reference/remember-me.html What I have done so far: Created my own UserDetailsService to work with Hibernate / JPA. My impl. does not consider any remember-me stuff Considered configuration through appContext <security:remember-m...

Can we change DispatcherServlet context configuration file name?

In Spring web mvc 1) If we define DispatcherServlet as below <servlet> <servlet-name>appServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> </servlet> it looks for file named appServlet-servlet.xml under WEB-INF folder as mentioned in the spring reference. My question is ca...

What is recommended way for spawning threads from a servlet in Tomcat

Probably a repeat! I am using Tomcat as my server and want to know what is best way to spawn threads in the servlet with deterministic outcomes. I am running some long running updates from a servlet action and would like for the request to complete and the updates to happen in the background. Instead of adding a messaging middleware like...

Got Problems with Tuckey UrlRewriteFilter and Spring 3 Web MVC

Hi, I have a Spring Web MVC application and I want to use RESTful URLs. Regrettably I haven't found any configuration that works for me with Tuckey's UrlRewriteFilter. I'm using the "DefaultAnnotationHandlerMapping" and I added "urlrewritefilter.jsp" to my classpath and copied "urlrewrite.xml" into "/WEB-INF/". I wan't to achieve that ...