spring-mvc

How to display common information in multiple views in an MVC application?

What is the best way to share common objects between multiple views in an MVC application? Say I have a LoginController that takes a user name and password and authenticates the user and loads their data (account info, full name, etc.). I want to display this on each page - something like a header with "Welcome <user name>, you have <a...

Spring SimpleFormController - Including Search Form In Success View

UPDATE 1/31/10: Since this thread continues to get a lot of views...I am curious if it has been of help to anyone recently? Feel free to leave comments/feedback, thanks. I have a Spring form where I would like to reuse the search page to include the results under the search form. Currently when I do this I get the following error o...

Server Side Validation using Spring Web MVC validator class

Hello All... I am developing app using Spring Web MVC, Hibernate.. Now, i have my login page configuration like : <bean name="/uservalidate.htm" class="UserValidateFormController"> <property name="sessionForm" value="true"/> <property name="commandName" value="User"/> <property name="commandClass" value="User"/...

combo box in spring web mvc

Hello All... I am using spring web mvc for my app's UI part.. By using following code, i am getting List Box where i can select more then 1 value.. <form:select path="domainsList"> <form:options items="${domainsList}" itemValue="domain" itemLabel="domain"/> </form:select> But I need a drop down combo box... Can any one suggest how...

How to use Ajax JQuery in Spring Web MVC

Hello All.. I am using spring web mvc for my application. I have 1 dropdown list in my JSP View, coming from following request called savegroup.htm <bean name="/savegroup.htm" class="com.sufalam.mailserver.presentation.web.GroupSaveController"> <property name="sessionForm" value="true"/> <property name="command...

Spring 3 Collection Binding

How I can bind a collection to a form for inputdata (not for show) ...

Spring SimpleUrlHandlerMapping not allowing routing for any html page

I'm trying to implement a file upload in my Spring application based on the Spring documentation. However, when I add the SimpleUrlHandlerMapping reference, I can't even route to my login page. In my web.xml, I have all .htm files mapped to my servlet: <servlet-mapping> <servlet-name>myapp</servlet-name> <url-pattern>*.htm</url-...

How can I Convert XML to an Object using Spring 3.0 mvc while making RESTful request

Hi, I'm using the Spring 3.0 RC1 framework and I'm currently testing out Spring mvc. I wanted to use Spring mvc to handle restful requests. I have set up my controller to handle the URI request. I am passing in xml with the request. So on the controller I have a method like follows: public void request(RequestObject request) { d...

Spring - Best approach to provide specific error messages in a validator from a DAO?

What is the best way to implement a validator in Spring that accesses a DAO object but needs to return different error messages based on the DAO error? Should the DAO method throw different exceptions that the validator turns into proper error messages? Should the DAO return an enumeration so the validator can handle each return type s...

Resource Bundle Spring

How can I access the messages from a resource bundle in Spring MVC inside a class that extends from AbstractController? I have tried getMessageSourceAccessor().getMessage("a.message"); but it it throws this Exception: org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.spring...

Spring integration with Struts 1 - injecting dependencies to the ActionForm

Hi all, We are expanding an old Struts 1 project to be Spring managed - yet we wish to change the code and the flow as little as possible. We have therefore decided to leave Struts to manage the requests and have delegated the actions via the org.springframework.web.struts.DelegatingActionProxy class. Example: The struts-config.xml co...

getModel() vs getModelMap() in ModelAndView

Which one has to be used when ? When I see the source code of ModelAndView class, getModel() is simpling calling the getModelMap(), Why are there two different methods doing same activity ? ...

Implementing Spring MVC 3.0 controller

Trying to implement clean URLs (without .form, .do, etc.) with Spring MVC 3.0 (actually it's a basic example from Spring reference). The problem that it just don't work: http://localhost:8080/ct/helloWorld gives a 404 page. Below are my sources, plese help to find an error. HelloWorldController.java package controllers; import org.sp...

SimpleFormController help

Hi, I am very new to Spring and I have been given some basic instructions to move some code into a new project that uses Spring and I am having trouble with the SimpleFormController (which I was instructed to user). I have a page and when it loads it has a drop down with data populated from the DB. A list of "messages" is retrieved fr...

Spring MVC on Oracle 11gR1

Hi I am using Eclipse webtools to develop a hello world application that runs on oracle 11gR1 development server. I use the Oracle eclipse tools to perform the deployment on the server. I am following the 'Developing a Spring Framework MVC application step-by-step' guide. I passed step 1 by having a simple jsp work. But step 2 brings m...

Exception thrown after processing onSubmitAction

Hi, I am very new to Spring and I have a simpleFormController with 2 methods. referenceData() with is called when the page loads and onSubmitAction() which is called on the submit of a form. I am getting a nullPointerExcpetion after all my onSubmitAction() code has completed and I suspect it has something to do with where the flow of ...

How to implement Logout feature using Spring Web Mvc

Hello All... I am new to Spring Web MVC.. Can I get some example or online link that shows me how to implement logout feature using spring web mvc ? I don't want to use the in built feature of spring security (i.e. ACEGI).. Thanks in advance... ...

Spring Advice - submitting a form

Hi, I am having serious problems with code I have written with Spring so I have decided to start from scratch and ask for advice. Here are my requirements: When the page first loads I need a list of objects retrieved from the DB that I can access on the JSP. I use this list to populate a drop down. When the user selects an object...

Spring MVC Annotations with Global Context context:component-scan?

I have a spring dispatcher servlet with servlet-name "spring-mvc". The spring-mvc-servlet.xml appears as follows: <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> <property name="prefix" valu...

Rewrite spring-security redirect URLs

I'm trying to get Tuckey UrlRewriteFilter to tidy up URLs for my webapp. One problem I've got is that when spring-security notices that an anonymous user is trying to access a protected resource it redirects to a URL which includes the servlet path. What I'd like is, by example: > GET http://localhost:8080/my-context/protected-resource...