spring-mvc

Loading external xsd and dtd render my application long start up time

I'm developing a webapp using tiles and spring mvc. With the use of xsd and dtd validation on the definition of tiles and bean declaration of spring mvc, each time the web app is start/restart, then requests are sent to external server for xsd and dtd files. I notice that because my webapp failed to start casually due to failed request t...

Can we use spring FTL based form validations with any controller other than SimpleFormController

Hi, Because of some design specification we have to extend all controllers in spring MVC from a class that extends AbstractCommandController. I am trying to include the spring FTL based form validations in my FTL file, but it gives me an error like Method public org.springframework.web.servlet.support.BindStatus org.springframewor...

In Spring MVC (2.0) how can you easily hook multiple pages/urls to use 1 controller?

<!--dispatcher file--> <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/foo/bar/baz/boz_a.html">bozController</prop> </props> </property> </bean> <!--mappings file--> <bean id="bozController" class="com.mycompany.foo.bar.baz....

Spring MVC: Where to place validation and how to validation entity references.

Let's say I have the following command bean for creating a user: public class CreateUserCommand { private String userName; private String email; private Integer occupationId; pirvate Integer countryId; } occupationId and countryId are drop down selected values on the form. They map to an entity in the database (Occupati...

AJAX - Get response URL after redirect

Hello, I was wondering if there is a way to get the URL of the returned resource after a AJAX call in JavaScript? I want to use this with a form, which is in "mysite.com/users/add.html". This is a Spring MVC controller. If the validation of the form fails the controller will return the "users/add" view, but if the validation is OK it w...

Explain the pros and cons of using the spring framework

Saw this question in career cup website. can someone Explian the pros and cons of using the spring framework ...

Spring redirect: prefix issue

Hello, I have an application which uses Spring 3. I have a view resolver which builds my views based on a String. So in my controllers I have methods like this one. @RequestMapping(...) public String method(){ //Some proccessing return "tiles:tileName" } I need to return a RedirectView to solve the duplicate submission due to upd...

Spring 3 Controller Exception handler implementation problems

I was hoping to implement a single "ExceptionController" to handle exceptions that are thrown in execution of my other controllers' methods. I hadn't specified any HandlerExceptionResolver in my application context so according to the API documentation the AnnotationMethodHandlerExceptionResolver should be started. Verified as such in th...

Spring MVC: should service layer be returning operation specific DTO's ?

In my Spring MVC application I am using DTO in the presentation layer in order to encapsulate the domain model in the service layer. The DTO's are being used as the spring form backing objects. hence my services look something like this: userService.storeUser(NewUserRequestDTO req); The service layer will translate DTO -> Domain obje...

Is the REST support in Spring 3's MVC Framework production quality yet?

Hi all, Since Spring 3 was released in December last year, I have been trying out the new REST features in the MVC framework for a small commercial project involving implementing a few RESTful Web Services which consume XML and return XML views using JiBX. I plan to use either Hibernate or JDBC Templates for the data persistence. As a ...

Spring @InitBinder not invoked when showing form => CustomEditors not defined

hi, I have following (simplified to the bone) Controller: @Controller public class TestController { @RequestMapping(value = "/test.htm", method = RequestMethod.GET) public String showForm(final ModelMap map) { final TestFilter filter = new TestFilter(); filter.setStartDate(new Date(System.currentTimeMillis())); map.addA...

Setting nested object to null when selected option has empty value

Hello, I have a Class which models a User and another which models his country. Something like this: public class User{ private Country country; //other attributes and getter/setters } public class Country{ private Integer id; private String name; //other attributes and getter/setters } I have a Spring form where...

How to import a resource when using Castle Windsor

Hi, I'd like to hold my components in a separate xml file for production, development etc etc. Can this be done with Castle Windsor? When using spring.net, i can use <springDestinations> <objects xmlns="http://www.springframework.net"&gt; <import resource="file://~/Config/blablabla.xml"/> </objects> </springDe...

Implementing EAV pattern with Hibernate for User -> Settings relationship

I'm trying to setup a simple EAV pattern in my web app using Java/Spring MVC and Hibernate. I can't seem to figure out the magic behind the hibernate XML setup for this scenario. My database table "SETUP" has three columns: user_id (FK) setup_item setup_value The database composite key is made up of user_id | setup_item Here's the...

Spring security problem, Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping'

Hello; I'm developping a web application with spring mvc, i started by developping the web application after i'm trying to add spring security; but i have this message, and i don't find a solution, thanks 16-04-2010 12:10:22:296 6062 ERROR org.springframework.web.servlet.DispatcherServlet - Context initialization failed org.springframe...

Location of view.properties in my proyect spring mvc jasperreports

Hello, i´m trying to generate reports with jasperreports, acording to documentation i need to configure the ResourceBundleViewResolver like this. <bean id="resourceBundleView" class="org.springframework.web.servlet.view.ResourceBundleViewResolver"> <property name="basename" value="views"/> </bean> And a file called view.prop...

Restlet vs Spring MVC for Restful web service

I'm researching how best to create a Restful web service on Google app engine. My end goal is to have an Android application call a web service on GAE to post and get data. At this point I not sure what the best approach is. What I know at this point is Spring MVC 3 provide the ability to create web service but it does not provide a ...

Ajax and sophisticated graphics in Java web-app

In my opinion WWW will sooner or later come to full-blown AJAX web-sites, so that we wouldn't have page reloads every time you click somewhere. Now I want you to ask this. What tools and frameworks can one use to make a Java Web-application running on Tomcat have AJAX functionality like "in-place, with no page reloading" table sor...

Who creates beans in a spring web appplication?

I know that in a standalone application I create one of the application context instances which in turn creates the beans from conf files. But I can not see any such code in dispatched servlet. How then are the beans created in a web application? ...

Getting a Web Accessible Directory in Spring-MVC/Java

Simple problem, I need to write a sitemap to my web root directory so that it is accessible as so: http://mysite.com/sitemap.xml I want the code to look like: File f = new File( someMethodToGetWebRootDirectory() ); But I don't know what should be in that method ...