package de.terrestris.shogun2.web;

import java.util.List;
import java.util.Locale;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import de.terrestris.shogun2.model.Application;
import de.terrestris.shogun2.service.ApplicationService;

/**
 * @author Nils Bühner
 * 
 */
@Controller
@RequestMapping("/application")
public class ApplicationController {

	private static final Logger LOG = Logger
			.getLogger(ApplicationController.class);

	@Autowired
	private ApplicationService applicationService;

	@RequestMapping(value = "/create.action", method = RequestMethod.GET)
	public @ResponseBody
	Application createApplication(String name, String description) {
		LOG.info("Requested to create a new Application.");

		Application application = new Application();
		application.setName(name);
		application.setDescription(description);
		application.setLanguage(Locale.getDefault());

		return applicationService.saveOrUpdate(application);
	}

	@RequestMapping(value = "/findAll.action", method = RequestMethod.GET)
	public @ResponseBody
	List<Application> findAllApplications() {
		LOG.info("Trying to find all Applications.");

		return applicationService.findAll();
	}
}

@@ -678,12 +678,8 @@
 gger
-%0A%09%09%09
 .get
@@ -869,18 +869,17 @@
 onseBody
-%0A%09
+ 
 Applicat
@@ -1310,18 +1310,17 @@
 onseBody
-%0A%09
+ 
 List%3CApp
@@ -1443,11 +1443,233 @@
 ll();%0A%09%7D
+%0A%0A%09@RequestMapping(value = %22/get.action%22, method = RequestMethod.GET)%0A%09public @ResponseBody Application get(Integer id) %7B%0A%09%09LOG.info(%22Trying to get application with ID %22 + id);%0A%0A%09%09return applicationService.findById(id);%0A%09%7D
 %0A%7D%0A

Add a simple get method to the app controler.