spring-roo

Spring MVC /Roo - Request method 'GET' not supported

夙愿已清 提交于 2019-12-25 08:58:43
问题 @RequestMapping(value = "/tusers") @Controller @RooWebScaffold(path = "tusers", formBackingObject = TUser.class) public class UserController { @RequestMapping(value = "/tusers/{id}", produces = "text/html", method = RequestMethod.GET) public String show(@PathVariable("id") Long id, Model uiModel) { uiModel.addAttribute("object", tUserService.findTUser(id)); uiModel.addAttribute("itemId", id); return "tusers/show"; } Why does this give me HTTP Status 405 - Request method 'GET' not supported on

Using converters in a list with Spring Roo

时光怂恿深爱的人放手 提交于 2019-12-25 00:29:14
问题 Now that I found how to use converters in an HTML SELECT in Spring Roo, I am trying to do the same in a list. I managed to register a Converter in my ApplicationConversionServiceFactoryBean, but now I need to use it as well when displaying a list of my envities. I have the following entity : @RooJavaBean @RooToString @RooEntity public class Environment { @NotNull @Size(min = 2, max = 30) private String name; @ManyToOne private Application application; } When displaying it as a list in the

Implementing cross-validation in java

假如想象 提交于 2019-12-24 20:35:22
问题 I use Spring Roo + jpa + hibernate and I would like to implement cross-validation (validation of several fields at the same time) in my application. I am not sure how to go about implementing it. Can anyone please advise me and/or direct me to relevant documentation? 回答1: Have a look at Hibernate Validator, which allows entity validation (using annotations). http://www.hibernate.org/subprojects/validator.html In short, you annotate your field constraints by placing hibernate validator/ JPA

Accessing Service Layer from custom Controller in Spring MVC

≡放荡痞女 提交于 2019-12-24 10:02:57
问题 I am new to Spring and ROO and this Annotation/Aspect hell. I have an Spring MVC Project created with Spring ROO. I use mongo-db as my persistance layer. I have an entity Report with the domain object, the service, the repository and the controller. I added a custom controller wich workes so far. I want to just access my stored reports with the ReportService.findAllReports() , but I'm not sure how to get access to this service. Here is a link to my roo generated site http://sauberseite

Multiple component-scan

僤鯓⒐⒋嵵緔 提交于 2019-12-24 07:18:22
问题 I used Spring ROO to generate a MVC Project. I see the first component-scan at webmvc-config.xml loaded via org.springframework.web.servlet.DispatcherServlet in web.xml file: <context:component-scan base-package="com.nexlabs.countryapp" use-default-filters="false"> <context:include-filter expression="org.springframework.stereotype.Controller" type="annotation"/> </context:component-scan> <mvc:resources location="/, classpath:/META-INF/resources/" mapping="/resources/**"/> Now in another

Using roo to create a springsource project with mongo

柔情痞子 提交于 2019-12-23 11:36:08
问题 Preface: I am coming from a .NET and PHP backround. I'm pretty comfortable with making a console app in Java. I've never used an ORM on any platform. I'm trying to learn enterprise java best practices. Therefore, if I sound ignorant, its probably because I am. I downloaded the latest version of the SpringSource Tool Suite. I want to make a spring project with a JPA mongo (adapter/driver/driver whatever). I'd like to do so with roo. So what I think I need to know is the name of a JPA library

How to integrate facebook graph api in Spring Roo

99封情书 提交于 2019-12-22 15:00:12
问题 I am very new to Spring Roo. I have decided to create my first project in Spring Roo that should implement facebook graph api. I have found few api (fbRest, facebook-api-java) after searching over the internet but some blogs say these are old. I don't know, where i get appropriate api that is supported by spring roo and how to start? Any help be appreciated. 回答1: You can simply integrate Spring Social add-on to add Social features to your Spring Roo project, just like you would do for any

Spring-roo REST JSON controllers mangle date fields

北战南征 提交于 2019-12-22 08:40:38
问题 I have a data entity that I use in two ways, I populate a table with some of its data when the page loads, and when you click a row of that column, I AJAX up the details of that item and display them in form fields. I'm using Spring-Roo generated REST endpoints on the server side, and Backbone.js on the client. When the table loads, date fields have the format I expect, coming straight out of my MySQL database ("yyyy-MM-dd"). When I get my AJAX data, date fields come to me as Unix time values

In Spring Roo : what is a dynamic finder?

只愿长相守 提交于 2019-12-22 06:17:11
问题 I am getting a look at the Spring Web framework with Roo. And, I am looking at the vote.roo supplied in the sample directory. This line called my attention: finder list --class com.springsource.vote.domain.Vote --depth 2 --filter reg,betw,IpEq In Spring Roo : what is a dynamic finder ? What does mean this line? Thanks 回答1: Roo can be used to generate Finder methods on your Entity classes. In other words, it will create a static method on an Entity that can query the back end for a particular

In Spring Roo : what is a dynamic finder?

冷暖自知 提交于 2019-12-22 06:16:09
问题 I am getting a look at the Spring Web framework with Roo. And, I am looking at the vote.roo supplied in the sample directory. This line called my attention: finder list --class com.springsource.vote.domain.Vote --depth 2 --filter reg,betw,IpEq In Spring Roo : what is a dynamic finder ? What does mean this line? Thanks 回答1: Roo can be used to generate Finder methods on your Entity classes. In other words, it will create a static method on an Entity that can query the back end for a particular