spring-mvc

urlrewrite and opensessioninviewfilter doesn't work together

I started my new Spring mvc project and I decided to go with SpringSource ToolSuite. When I create a project it automatically creates urlrewrite filter in my web.xml, which I'm enjoying very much. However, this brilliant urlrewrite thing doesn't seem to work with opensessioninviewfilter. Does anybody can help me? Here is my web.xml(I tr...

Programmatic login doesn't work with subDomains ?

greetings all i am using the following method to make an auto login for user after registration to access an authenticated page: public static void autoLogin(User user, HttpServletRequest request, AuthenticationManager authenticationManager) { GrantedAuthority[] grantedAuthorities = new GrantedAuthority[] { new Gran...

Spring 3.0 MVC Ajax example

Hi I'm trying to send Ajax request to Spring MVC controller and map it to Java class accordingly: public class Person implements Serializable { private MutableLong Id = new MutableLong(); @NotEmpty @Size(min = 1, max = 50) String FirstName=null; @NotEmpty @Size(min = 1, max = 50) String LastN...

Setup a Filter that will set the Response Header to only Image File(s)

I am having a caching problem based on the discussion that I have in this link But I am not sure how to go about with the suggestion on setting the response headers on my Spring MVC. Does anybody know how to setup a some sort of a filter that will add add a response header only on image files? I currently am not an expert on J2EE web ...

Spring UserDetailsService is not Serializable session attribute in google-apps-engine

Here we have a Spring based webapp in google apps engine. I've created a UserDetailService class to load the UserDetails from the GAE data store (assuming this is the best approach). @Service("springUserDetailsService") public class SpringUserDetailsService implements UserDetailsService { @Resource(name="userDao") private IUs...

SecurityException w/ VelocityViewResolver in Google-apps-engine using spring/velocity

I get the following security exception in GAE, anyone know the cause? Google searches are taking me in all different directions. java.lang.SecurityException: Unable to get members for class org.springframework.web.servlet.view.velocity.VelocityViewResolver at com.google.appengine.runtime.Request.process-510220b4f73f2116(Request.java...

Binding Properties of Primitive Wrapper Types with Spring MVC

Hello folks, It appears to me that Spring MVC cannot bind properties of primitive wrapper types(e.g. Integer, Boolean, etc). When it tries to bind such properties, it throws the following exception. javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.servlet.jsp.JspException: org.springframework.beans.NotReadablePrope...

Spring: serializing objects with references to non-serializable beans

The class below (my implementation of UserDetailsService) gets tied to the session and the session gets serialized (in google apps engine). I watched a Spring 3 presentation recently that said that beans, such as userDao, shown below, are loaded by a proxy which doesn't serialize the bean, but stores only the name and re-obtains the re...

POJO to MultiValueMap mapping/binding/conversion in spring 3

I have a POJO I need to format as a MultiValueMap. This MultiValueMap will be used as the request in a POST method using the restTemplate class and will be passed along to my web service as contentType application/x-www-form-urlencoded. Are there any tools or utilities that will do the POJO -> MultiValueMap conversion for me? sample...

Storing objects in session within MultiActionController page

hi How to store/cache a List within a Controller in Spring 3.0 Thanks Gauls ...

Mapping problem with Spring

Hi, I'm working with Spring MVC. I have a controller which returns a new ModelAndView(new RedirectView(getSuccessView())). SuccessView is set as home.htm which is a virtual page that maps to WEB-INF/jsp/home.jsp. However I'm getting this error: No mapping found for HTTP request with URI [/Bikes_Spring/WEB-INF/jsp/home.htm] in Dis...

portal:actionURL Spring MVC Portlet

I am trying to create a actionUrl using the following code <portlet:actionURL var="actionUrl"><portlet:param name='action' value='viewModules' /></portlet:actionURL> and map that onto a spring controller However the controller does not respond as the generated url's ampersands are encoded e.g. <snip>&amp;p_p_lifecycle=1&amp;p_p...

How to create a form login with Spring Framework on Google App Engine

I'm new to Spring and GAE, and I assume this is easy, so don't overlook the simple answer. In spring I understand that I need to create an implementation of UserDetailsService which populates UserDetails for the security framework on authentication. After doing this I got a NotSerializableException on my SpringUserDetailsService bean, ...

Session variable not set in Spring

Hello, I have a Spring controller which is putting a variable in the session: public class LoginFormController extends SimpleFormController { public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command) throws Exception { request.getSession().setAttribute("authenti...

What's the difference between <mvc:annotation-driven /> and <context:annotation-config /> in servlet?

Hello! I am migrating from Spring 2.5 to Spring 3. They have introduced <mvc:annotation-driven /> which does some black magic. This is expected to be declared in servlet configuration file only. In spring 2.5 I have just used <context:annotation-config /> and <context:component-scan base='...'/> tags declared both in application-cont...

Spring and Hibernate: How to modify user authorities using jsp and checkboxes

I am using spring security and have an admin jsp page for editing user details. I want to be able to grant or revoke authorities on this page. The following checkboxes tag works to display a given user's existing authorities: <form:checkboxes path="authorities" items="${roles}" delimiter="<br />" /> where authorites is an attribute ...

spring 2.5.6 tiles integration

I have been searching to determine what is required to integrate Tiles and Spring 2.5.6. So far the integration has not been successfully. I tried to make use of the version of Tiles that is included with the Spring bundle (V2.0.4) and the latest version and still does not seem to work. I get the following error from JBoss: org.sprin...

JSF Limitations

I'm currently just exploring JSF 2 in the JEE 6 stack. I find quite a bit of limitations with JSF and the way ManagedBeans are used is very counter-intuitive / odd: It seems that, in order to execute an action event, you have to use <h:commandLink> tag. Thats all well if I was for example, posting form data. However in this case, all I...

Separating service layer from web layer in a Spring application

I am currently learning Spring. So far I have created a basic application consisting of Hibernate/JPA entities, DAOs and classes that perform business logic. This I am calling the service layer. If I now wish to use SpringMVC to add a web front end to this application, how should I separate the two? i.e. do I need to create a separ...

Not able to resolve ClassNotFoundException for DispatcherServlet (on Spring)

Hi! here is my web.xml : <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd "> ...