spring-mvc

Best way to validate URL parameters in Spring MVC website?

I am using Spring MVC to build my web application, and I have a question about validating parameters I receive in the URL. What is the best way to detect invalid parameters and display errors to the user? Suppose I have a "View User Profile" page. The profile that is displayed is based on a user ID parameter specified in the URL. I migh...

Resource for learning Spring MVC

I am looking for an online resource to learn the Spring MVC stack. Can someone point me in the right direction? ...

Spring - binding to an object rather than a String or primitive

Hello, Let's say I have the following command object: class BreakfastSelectCommand{ List<Breakfast> possibleBreakfasts; Breakfast selectedBreakfast; } How can I have spring populate "selectedBreakfast" with a breakfast from the list? I was figuring I'd do something like this in my jsp: <form:radiobuttons items="${possibleBreakfas...

Does anyone know how to successfully integrate Seam and Spring MVC?

As the title says. Is there a way to integrate the two? ...

Spring MVC Webapp: Where to store paths to common images?

I'm building a Spring MVC web application with Tiles/JSP as the view technology. Previously I stored the paths to common images in class Common: public final static String IMG_BREADCRUMBS_NEXT = "/shared/images/famfam/bullet_arrow_right.png"; Then I would use this class in jsp to get the image src like <img src="<%= Common.IMG_BREA...

Simple autosave for Spring MVC form

I have one page form done with Spring MVC. User has to register first and I would like the form to be saved automatically so user can come later to finalize it. Traditional form submission with a timer is not what I'm looking for. Instead, I am planning to use some ajaxy way to send fields to the server at each onFocus event. Any sugges...

Grails: checkbox not being set back to false

I am developing a Grails (1.0.4) app where I want to edit a collection of collections on a single page in a grid view. I got it to work quite well depending only on the indexed parameter handling of Spring MVC, except for one thing: boolean (or, for that matter, Boolean) values in the grid can be set via checkbox, but not unset, i.e. w...

Error while splitting application context file in spring

I am trying to split the ApplicationContext file in Spring. For ex. the file is testproject-servlet.xml having all the entries. Now I want to split this single file into multiple files according to logical groups like : group1-services.xml, group2-services.xml I have created following entries in web.xml : <servlet> <servlet-name>t...

Split Application Context File in Spring

Hello, I would like to have step-by-step information on : how to split the ApplicationContext file (eg.: myapp-servlet.xml) into multiple XML files in Spring with some examples ? I have tried configuring web.xml with "ContextLoaderListener" and have contextConfigLocation like : <init-param> <param-name>contextConfigLocation</...

Spring MVC with an externally rendered PDF as the view

Is there a built-in mechanism in Spring that would allow me to display an externally rendered PDF as a view? I've fetching PDF via a webservice (returned an attached DataHandler) so I'm not looking to subclass AbstractPdfView to render PDF. This isn't a hard problem to solve on its own; it would be easy enough just to write the PDF to...

How is the Spring MVC spring:bind tag working and what are the meanings of status.expression and status.value ?

Let's discuss on the following example: <spring:bind path="user.userName"> <input type="text" name="${status.expression}" value="${status.value}"/> <span class="fieldError">${status.errorMessage}</span> </spring:bind> When this view snippet gets rendered, what do ${status.expression} and ${status.value} get evaluated to? Where...

Client side object velocity

I would like to create an object client side and add it to another object. I'm using velocity and Spring. I form a command object and pass it to the view as a backing object. I want to create and add a new object to this command object without saving either object to the db. The reason for this is that I want to have some persistence...

Convention over configuration with Spring MVC using ControllerClassNameHandlerMapping?

Following the directions from Spring Source and the book Spring in Action, I am trying to set up Spring MVC in a way that minimizes xml configuration. However according to Spring Source this is how you set up the ControllerClassNameHandlerMap <bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/> ...

Finding your application's URL with only a ServletContext

I'm writing a Java web app using Spring MVC. I have a background process that goes through the database and finds notifications that must be e-mailed to my users. These e-mail messages need to include hyperlinks to the application. This seems like a fairly common pattern for a web app, but I'm having trouble. How do I derive my applicat...

Spring MVC, generating a form backing object from a request?

I am using Spring MVC 2.5, and I am trying to get a JSTL form object to load from a GET request. I have Hibernate POJOs as my backing objects. There is one page directing to another page with a class id (row primary key) in the request. The request looks like "newpage.htm?name=RowId". This is going into a page with a form backing object...

designing consoles for hardware appliances

What are the best practices in designing UI for hardware appliances? Are there any frameworks in Java that are particularly suited to this task? ...

Spring MVC form:select Tag, multiple selections not binding correctly?

I am trying to create a form to edit an existing database row. I am using the Spring MVC form tag to auto bind the html to a form backing object. The row has a many to many relationship with another table, which I am trying to represent with a multiple select box using the form:select tag; <form:select path="rules"> <form:options items...

What are all the portlet classes in Spring mvc?

In Spring MVC there seem to be two parallel class hierarchies, one with portlet, one without. What is that? Why is it so and what should I use. ...

portlet 2.0 (jsr286) development with spring

Hi! We are discussing whether it's a good idea to switch from plain portlet development on a liferay installation to spring webmvc portlet based development. We're starting the development of some portlets soon, so now is the time. But the problem I see is that we'd like to use some of the portlet 2.0 features, which won't work with ve...

Spring MVC web app i18n

In a web application written using spring-MVC, I want to allow users to change the current language by clicking on a link which text is the name of the language. I have already set up a messageSource and made all my jsp pages find the messages using this messageSource. Currently, the language is changing depending on the locale of the ...