spring-mvc

ROO IDT Push In results in a "Requested Resource not found"

I have a scaffolded controller with a populate method. I wanted to customize this method so I did an IDT 'push in' and re implemented it. Everything compiled and roo updated the aspect, but when accessing the controller with the browser I get a "Requested resource not found". I'm using SpringSource tc Server Developer Edition v2.0. No e...

Hibernate using Query via Spring injection

Hello all, Beginner here to hibernate, spring. Followed tutorial here to setup hibernae + spring + struts2 project: http://splinter.com.au/blog/?p=224 I wanted to prepare queries. So I tried following: Services.java public class Services { protected SessionFactory sessionFactory; public void setSessionFactory(SessionFactory value) ...

Spring 3 Portlet - data not updating on a page refresh

I'm trying to write a simple portlet using Spring 3 to run in Liferay. It's two pages - you can view an ordered list of items (they are just strings), and if you go to the edit page, you can change the order of the items in the list. On the edit page, you can either move an item up or down, one level at a time. So for example, when you c...

Migration from Struts 1.2 -> Struts2 vs Spring-MVC (primarily vis-a-vis Struts1.2 taglib support)

Primary Question: If my app is CURRENTLY using Struts 1.x - and I am considering migrating to EITHER Spring-MVC or Struts2 for the MVC-framework - is there anything about either one that would make it easier to migrate from Struts1.2? To clarify, I am NOT asking whether SpringMVC or Struts2 is better overall (there are a number of exis...

Is it possible to set a domain object as a hidden field in spring forum bean ?

greetings all i have a domain class named car and i have an object from car retrieved from the DB and i want to save this object in the form as a hidden field in order when submitting to get this object but when i tried <form:hidden path=carObj /> it didn't work, any ideas why, and how to do such behaviour ? ...

navigating between forms using annotation-based controllers

I am new to annotated controllers and i have a problem. Ive heard it is possible to navigate between forms using them, but cant achieve that. Well probably I could use SWF but for whole project controllers are more suitable. My controllers looks like this: @Controller public class AnDBChooseController { @RequestMapping("/dbchoose") ...

ajax login with spring webMVC and spring security

I've been using Spring Security 3.0 for our website login mechanism using a dedicated login webpage. Now I need that login webpage to instead be a lightbox/popup window on every webpage in our site where upon logging in I get an AJAX result whether it was successful or not. What's the best way to go about this with Spring Security and ...

How can I change the ordering of mapped URLs in Spring MVC?

I'm running Spring MVC 3.x and I have one Controller with RequestMapping annotations (DefaultAnnotationHandlerMapping) and I have one ServletForwardingController with some additional mappings via SimpleUrlHandlerMapping. When I boot up my application, I see the following: ... 13:24:17,747 INFO [DefaultAnnotationHandlerMapping] Mapped U...

Can i use Spring's @RequestMapping and BeanNameUrlHandlerMapping in conjuntion with each other to map a URL to method?

What I would like to do is have a common Service class which has various methods such as "search" "retriveByID" etc. Ideally this class would consume the service parameters and populate a request object and hand off to the appropriate data source handler. I want to instantiated a service class as a Spring bean with different request h...

How to display a formatted DateTime in Spring MVC 3.0?

Hi, I have a Joda-DateTime field in my model and want to display it formatted in a JSP view. I have annotated it with the new @DateTimeFormat annotation: public class Customer { private DateTime dateOfBirth; @DateTimeFormat(style="M-") public DateTime getDateOfBirth() { return dateOfBirth; } } Now I want to display ...

Liferay portlet not calling correct render method (ignores setRenderParameter)

I have a portlet which has many rendering and action methods: @Controller @RequestMapping("VIEW") public class CartController { @RenderMapping() // default render method public String defaultRender(RenderRequest req, RenderResponse res, Model model) throws PortalException, SystemException { ... } @RenderMapping(params="acti...

In grails, what is the quickest way to obtain a reference to the current hibernate session?

I got a singleton service and inside its only method I need to obtain a reference to the hibernate session bound to the current request. What is the quickest way of doing that? ...

Guides for Spring MVC 2.5 or 3

Hey, Am I alone in inability to find any guide for building Spring 2.5/3 MVC web applications or what? I don't know what is going wrong with Spring docs, it became worst since VMWare acquired SpringSource. Thanks. ...

jqgrid java list from controller

Hello... I have a jqgrid where in I am returning a list of objects from the controller... I have used the List collection interface of java.util package.... and returning that... @RequestMapping("task-management.html") public @ResponseBody List<TaskBean> getStatus() { System.out.println("\nin task mgmt controller"); taskList.ad...

How can I validate request arguments in SimpleFormController - Spring MVC

Hi. I want handle update operation using SimpleFormController. URL to this controller looks as follow: http://example.com/updatesomething.html?id=42 I wonder how to validate on the begining if object with the given id (42) exists, because I want display 404 error page when id is incorrect and stop processing. Thanks in advance f...

Spring framework self-training

I'd like to learn Spring MVC framework basis. My personal experience tells clearly that more than reading manuals, docs, howtos only is only one important part of self-training, but to capitalize real experience you need to solve real problems. May someone suggest a fake-project that I can implement in my free-time, avoiding only-theoret...

Spring MVC 3.0: Is String the preferred type to be used for @PathVariable?

Pardon me for asking such a simple question here as I'm new to Spring MVC 3.0. I have been reading the documentation from spring source website a few times. Here's a code snippet that I'll refer to for my question below:- @RequestMapping("/pets/{petId}") public void findPet(@PathVariable String petId, Model model) { // implementatio...

Send Multiple Data to DB in Spring

Hi, I have this scenario in my Spring MVC Apps. User has to choose what hobbies he/she likes. He can choose at least one or many hobbies. My problem is this, If I need to save the list of hobbies into my DB, I am thinking of sending the list of hobbies that my user has chosen, delimited by a comma separator. Its like this: Baskteba...

getting org.springframework.web.bind.MissingServletRequestParameterException

Hi all, I am using spring annotations I have written one method public ModelAndView showTestPage(@RequestParam("firstInstanceId") String id1, @RequestParam("secondInstanceId") String id2, HttpSession session) { ModelAndView mv = new ModelAndView("showCompareItemList"); mv.addObject("pageTitle", "showCompareItemList"); mv.addO...

bind Spring HandlerInterceptor only to one controller

Using Spring 3.0.2.RELEASE. I'm having 2 Controllers in package com.myCompany. The Controllers are activated via Component-scan <context:component-scan base-package="com.myCompany" /> then I'm having a interceptor bind to the 2 controllers via <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMappi...