spring-mvc

Spring MVC and Checkboxes

I'm using Spring MVC 3.0 and can't quite see all the parts to this problem: my controller will produce a list of domain objects. Let's say a simple User object with firstName, lastName, age, and role properties. I want to output that list of users in a table (one column per property), each row also having a checkbox which are all selecte...

How do you model form changes under Spring MVC?

Please bare with me as I try to abstract this problem. Say your writing a web page for fruit vendors using Spring MVC's SimpleFormController, version 2.5.6. On this page the vendor can do simple things like change their name or their address. They can also change their inventory based on a drop down list filled with present inventory se...

trigger 404 in spring-mvc controller?

How do I get a spring 3.0 controller to trigger a 404? I have a controller with @RequestMapping(value = "/**", method = RequestMethod.GET) and for some urls accessing the controller I want the container to come up with a 404. ...

Does Spring 3.0 really support JSR-286?

Does Spring 3.0 Portlet MVC really support JSR-286 aka Porlet 2.0? I've seen anecdotal mentions of it but nothing in any documented form. If so, has anyone successfully implemented a JSR-286 plugin with Spring 3.0. If yes, on what platform? Any good reference information, or better yet, a sharable implementation? ...

accessing Spring MVC DI beans from jsp

Im bit confused so be patient if im trying to do something wrong : -) In some MVC frameworks you can call controller action from the view if you whish to execute some code and render some partial view. Im not sure what is the correct way to do it in Spring MV I want to have set of JSP templates. Some of them will be page layouts some o...

Multilingual web application problem

Hi all, I am working on Spring web application and my application is multilingual. I have created the ResourceBundle property files as messages.properties and messages_ar.properties. In my start page, I have set by default the locale to English. through: <fmt:setLocale value="en" scope="session"/> On the same page, I have provided u...

Not showing error messages when validated using @valid(JSR-303) in Spring MVC

I have specified <mvc:annotation-driven /> in dispatcher-servlet. I am not using @InitBinder. And I am using @valid annotation for validation in controller's method like @RequestMapping(method = RequestMethod.POST, value = "new") public String save(@Valid Article article,ModelMap model) { //code here } And validation works fine...

Trying to create REST-ful URLs with mulitple dots in the "filename" part - Spring 3.0 MVC

I'm using Spring MVC (3.0) with annotation-driven controllers. I would like to create REST-ful URLs for resources and be able to not require (but still optionally allow) file extension on the end of the URL (but assume HTML content type if no extension). This works out-of-the-box with Spring MVC as long as there are no dots (period/full-...

spring-mvc: error maping url for form controller

hello, i have a problem with spring mvc my spring bean <beans xmlns="http://www.springframework.org/schema/beans" xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/sp...

Add messages with Spring

I have seen that I can add errors and render them via <form:errors /> tag and addError() method of BindingResult class, but I wonder if there is something similar to send information messages to the JSP. I mean, I want to add messages when the operation has been successful. I know I could do it by sending an error, but it would make no ...

setting the spring bean at application level and accessing the same on jsp

How can I set a spring bean at application level (declaratively)and use the member of it on jsp ? ...

put with HttpMethodFilter not working with urlRewrite

i have put web.xml in which httpMethodFilter is used for converting post methods to put and delete,but not working with urlRewrite dispatcher org.springframework.web.servlet.DispatcherServlet 2 dispatcher /app/* <!-- For converting POST methods to PUT and DELETE methods--> <filter...

Default objects in spring 3 mvc SessionAttributes when session expired

I think im confused a bit about session annotation in spring mvc. I have code like this (2 steps form sample, step 1 user data, step 2 address) @SessionAttributes({"user", "address"}) public class UserFormController { @RequestMapping(method = RequestMethod.GET) public ModelAndView show( ModelAndView mv ){ mv.addObject(...

spring 3 mvc intercept all requests

Hi im wondering would it be possible to create global interceptor and set locale there. I have urlrewrite rules to rewrite /fr/* to /*?siteLang=fr I see examples how to set locale based on parameter but they all are the same and require me to use url mappings. Is it possible to do it globally so that locale interceptor gets called on e...

Not repeating a path twice in Spring 3.0 MVC Restful mappings

I'm mapping the url /modules/tips/SOME_ID/small to access the tip with id SOME_ID and to render it using the view small.jsp. The following code works great for this, however I am forced to repeat the string modules/tips in two places. Spring MVC doesn't seem to have a convention for this that I can determine. Other than using a consta...

Simple Spring Binding Question

Hi, I have some objects like the two below public class SavedSearch { String title; ArrayList<SearchParameters> params; } public class SearchParameter { String field; int operator; String match; } On the JSP page in the input form, I use <input type="text" name="title"> and when I breakpoint inside the FormController, the SavedSearch...

Validate Numbers in Spring

Hello, I have a basic doubt in how to proceed in my application. I have a form and I need to validate that all the inputs which are numbers. I have a problem in deciding the type of the attributes of the bean asociated with the form. I don't know if setting them to String or to double and here are the reasons: If I set them to double:...

Spring MVC with Webflow or Struts 2?

I am starting a new project and must decide between the two. The team has no experience in either. Both seem to have similar functionality. If you have experience in either technology, or both, I would appreciate your input. Thanks ...

spring security not eligible for auto-proxying

can anyone elaborate what does these info means when startup application? INFO: Bean 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) Jan 13, 2010 11:00:34 AM org.springframework.context.support.AbstractApplicationCont...

How to handle DataIntegrityViolationException in Spring?

I need to show custom messages in my Spring 3.0 application. I have a database with Hibernate and there are several constraints. I have doubts in how DataIntegrityViolationException should be handled in a good way. I wonder if there is a way to map the exception with a message set in a properties file, as it is possible in Constraints va...