controller « Web Service « Spring Q&A





1. Get Web App root from Spring Controller    stackoverflow.com

I am trying to write an uploaded multipart file to the filesystem. I have a directory called audio which sits in the root of my web application (not inside WEB-INF, ...

2. How configure a RESTful controller in Spring 3 with annotations?    stackoverflow.com

I am trying to create a RESTful controller using Spring 3.0. The controller is for a management API for a portal application. The operations I want to ...

3. Spring web application: executing common code before entering RequestMapping in controller    stackoverflow.com

I have a web application developed with Spring 2.5. The application has numerous controllers, containing GET and POST request methods, which are marked with RequestMapping annotations, like this:

@RequestMapping(method = RequestMethod.GET)
I ...

4. Spring 3.0 RESTful Controller Fails on Redirect    stackoverflow.com

I am setting up a simple RESTful controller for a Todo resource with an XML representation. It all works great - until I try to redirect. For example, when I POST ...

5. Should I create multiple services (using the Spring `@Service` stereotype) to do database lookups for different controllers?    stackoverflow.com

I'm not sure where to do database lookups for Spring controllers. It seems to make sense to use the Spring @Service stereotype and create multiple "services" to provide lookup support to controllers ...

6. How to make Spring MVC Controller error out if given a query param that is not valid or with a different case?    stackoverflow.com

Title pretty much says it all. One of the requirements of a web service I'm working on is that if a query param name is given that is either invalid or ...

7. How should you handle exceptions that occur below the level of the Controller in a Spring MVC web app?    stackoverflow.com

Let's say you've got a Spring web app with a structure like this:

com/
    myapp/
          controller/
     ...

8. Forward to a static html page from Controller    stackoverflow.com

My spring mvc application has one single ContentNegotiatingViewResolver that defines JsonView for rendering json resonses:

<mvc:annotation-driven/>

<context:component-scan base-package="world.domination.test"/>

<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
    <property name="mediaTypes">
        <map>
 ...

9. InvalidClassException during Spring RMI call to service bean from JSF IceFaces controller    stackoverflow.com

I've been developing a small proof-of-concept SOA application basically does a CRUD operation on a single data table using IceFaces and I've come up against a wall - probably due to ...





10. Java Spring 3 MVC Controllers explicitly load Services    stackoverflow.com

I'm working through some of Spring 3 annotation driven controllers and services and had a question on how this could be possible?

  1. I have in my servlet-context.xml file the paths for the ...

11. Returning an error and message from a Spring controller or service    stackoverflow.com

I'm migrating some servlets over to the Spring framework, using Spring MVC. Currently in each servlet we authenticate the user and if the authentication fails we do this:

if (authfailed)
{
  ...

12. Spring forward: prefix not working between REST controllers    stackoverflow.com

I've got a server application which is meant to serve as a web-application as well as a RESTful web-service. I manage to do this by clearly separating the controller classes for ...

13. @Controller throws NullPointerException when executes Service Object    stackoverflow.com

I am getting NPE when the service object in my @Controller calls its method. Can Any one help me please. I am a newbie and this is really stucking me. Here is ...

14. Why does @Autowired work in my Controller but not in my Service?    stackoverflow.com

In the MyController, @Autowired works fine to pull in myService without getters/setters:

@Controller
public class MyController
{
    @Autowired
    private MyService myService;
But when I try to apply the @Autowired ...

15. Spring 3, rest controller, mvc:annotation-driven, jdk 6 but spring refuses to send back xml responses    stackoverflow.com

This has been driving me nuts for days now. From what I've read I understand that I have two choices when it comes to auto-handling content with Spring MVC. I can ...

16. How to wire RESTFul Spring Controller along with MVC Spring Controller    stackoverflow.com

We are developing a Web application, in which we want to use Spring MVC Controllers and use RESTFUl Spring Controller. MVC Controllers are configured using wiring and NO Annotation is used, ...





17. Update method in Rest like controllers    stackoverflow.com

I want to write rest like method for entity update. In this case I retrieve entity id from url and data from request body. The issue is in binding id with ...

18. Cannot Autowire Service into Controller    stackoverflow.com

I have a spring application and I am trying to autowire my service into my controller but it keeps returning the same error: Error: No matching bean of type [org.sims.service.SIMSService] found ...

19. Spring Controllers using REST getting 405 errors    stackoverflow.com

----------------UPDATE---------------- I've entirely re-written my question in attempt to clarify what was apparently not well written. I've also included even more code in the hopes that someone can offer some help. My ...

20. Exception handler for REST controller in spring    stackoverflow.com

I want to handle exceptions so the URL information is automatically shown to the client. Is there an easy way to do this?

<bean id="outboundExceptionAdapter" class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver">
    <!-- what property ...

21. No controllers, services etc after SVN checkout    forum.springsource.org

Hi folks, I just tried out the grails tools for eclipse, and checked out an existing Grails project to my workspace. The problem is that the tools can't seem to find ...

22. Question about Spring 3 Rest controller behaviour    forum.springsource.org

Question about Spring 3 Rest controller behaviour Hi, I made Rest controller that needs to return 200 if a condition is met and 204 otherwise. And that's it, there's no further ...

23. Setting header values with Spring REST Controller    forum.springsource.org

@RequestMapping(value="/car/{carId}", method = RequestMethod.Get) public Car getCarById(@PathVariable("carId") String Id) { //get the car return myCar; }

24. Multiple Service configuration with one Controller    forum.springsource.org

Multiple Service configuration with one Controller Hi, I want to explain a scenario and want to know can we achieve the same. View layer submits the request and the request first ...

25. @Controller throws NullPointerException when executes Service Object's method    forum.springsource.org

@Controller throws NullPointerException when executes Service Object's method I am getting NPE when the service object in my @Controller calls its method. Can Any one help me please. I am a ...

26. Spring MVC Controllers that are only deal with Rest + JASON objects.    forum.springsource.org

Spring MVC Controllers that are only deal with Rest + JASON objects. I want do design my web application core part (skeleton) with Spring MVC with Rest + JASON, that mean ...

27. Help/Examples using the service layer outside of generated controllers    forum.springsource.org

Help/Examples using the service layer outside of generated controllers Hello! I have been testing the upcoming Roo through nightly builds and it seems really promising, especially for someone like me who ...

28. RESTful controllers without full scaffolding    forum.springsource.org

I want to use Roo's very nice generation of JSON-slinging RESTful controllers. I DON'T want a full HTML scaffold built--I'm building all the front end myself. I can't seem to find ...

29. Restful controller issue with SHA-256 encoded of activation Keys    forum.springsource.org

Hi, I am using Restful controllers. One of the controller is of the work /activate/${activationCode} I am using SHA-256 encoding of email id as my activationCode. Often this encoded code as ...

30. REST Controllers    forum.springsource.org

Guys: Does SpringMVC has implementation of REST controllers? How do I map the url to a controller and then the relevant method to be called based on the HTTP-Header. Thanks in ...

31. Portlet Controller and Service Object    forum.springsource.org

Jan 21st, 2007, 08:46 PM #1 joegaber View Profile View Forum Posts Private Message Member Join Date Sep 2004 Location North Carolina Posts 38 Portlet Controller and Service Object I have ...

32. Who should be responsible - Controller or Service Layer???    forum.springsource.org

Who should be responsible - Controller or Service Layer??? Friends, I am working on a web app, which is an online Exam System (like brainbench). For the test module which will ...

33. Multiple Webapps Sharing Controllers, Models, Views, Services and DAOs    forum.springsource.org

I would pack all my desired shared layers as JARs and deploy them as dependencies of each and every one of those 300 webapps. Yes, a lot of work. Are you ...

34. controller and service    forum.springsource.org

Whats the best design of how many services should be inside each controller. SimpleFormController could it have like 2 to 3 calls of services for each. Whats the benefit or disbenefit. ...

35. Controller vs Service vs private method on command object.    forum.springsource.org

Which is the better approach? 1.) have the command object be operated on inside the controller via onSubmit 2.) Have the command object be operated on by some private method in ...

36. Trying to Manipulate objects returned from Service in a Controller    forum.springsource.org

Trying to Manipulate objects returned from Service in a Controller So I have a simple controller returning a list of objects and putting them in a ModelMap Code: @Controller public class ...

37. changing pointcut from service layer to controller layer issue    forum.springsource.org

changing pointcut from service layer to controller layer issue Hey everyone I am using AOP for logging purporses. currently my pointcut is defined on the service layer which has a typical ...

38. [Rest] How to unmarshall objects in controller?    forum.springsource.org

[Rest] How to unmarshall objects in controller? Hello everyone, In the ItemsController (with @Controller annotation) I have a method with the @RequestMapping(value="/items", method=RequestMethod.GET) annotation. It adds an attribute to a Model ...

39. REST support: returning custom objects from Controller methods    forum.springsource.org

Hi guys, I have a Controller object with a @RequestMapping(value="...", method=GET)-annotated method where I would like to return a custom object, rather than a model or a view. I tried to ...

40. Spring 3.0 MVC - Auto-generate REST Controller Documentation    forum.springsource.org

I'm using Spring 3.0 MVC to create a REST web service. Are there tools out there that can look at your @Controller annotated classes and auto-generate API documentation for your REST ...

41. pizzashop application web controller issue    forum.springsource.org

I followed pizzashop tutorial from beginning with ROO in chaper 2. Everything was OK till I executed : controller all ~.web after that I imported project into STS , STS complain ...

42. Advice on REST style Controllers.    forum.springsource.org

Advice on REST style Controllers. Hi all, I am relatively new to spring & spring @MVC. I am trying to suport REST style URLs for my resources and am having a ...

43. Two questions about RESTful controllers    forum.springsource.org

How can you control the response code when there is a problem? I like to have my controllers setup to return a POJO and let a view do the conversion to ...

45. Controller can't find service    forum.springsource.org

Controller can't find service I am new to Spring and I can't find out why my controller raises a null pointer exception. My controller's code Code: @Controller @RequestMapping("/home") public class HomeController ...

47. Gathering data : at the Service level or Controller?    forum.springsource.org

When your page needs multiple sets of data, for example you are showing a forum and your page displays recent threads as well as a list of the top users, do ...

48. Command Object with RESTful controller?    forum.springsource.org

I am trying to look for a way to have Spring build a command object from a controller which is not a form backed controller. currently I have something like: Code: ...

49. Rendering String in RESTful Controller    forum.springsource.org

I have a controller which currently returns a custom Result object (simple pojo with JAX-B Annotations) and is in turn rendered to the client using the MappingJacksonJsonView or MarshallingView based on ...

50. Data Binding using in Controllers using RESTful mappings    forum.springsource.org

Data Binding using in Controllers using RESTful mappings Is the BindingResult feature not working for RESTful calls? Do in need to write a custom handler to support the following case: In ...