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...
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...
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"/...
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...
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...
How I can bind a collection to a form for inputdata (not for show)
...
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-...
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...
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...
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...
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...
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 ?
...
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...
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...
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...
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 ...
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...
...
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...
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...
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...