我正在慢慢尝试学习 Spring Roo,但在为我的应用程序生成查找器时遇到了困难。在浏览器上呈现的结果菜单显示查找器(链接)的存在,但是在单击链接时,我立即收到错误
HTTP Status 400 - Required Integer parameter 'population' is not present
type Status report
message Required Integer parameter 'population' is not present
description The request sent by the client was syntactically incorrect.
我已经尝试过两种gvNIX 1.4.0.RELEASE - Roo 1.3.1.RELEASE [rev 8cb81a3]
方式和普通Roo 1.3.1.RC1
方式(没有 gvnix 插件)。
从数据库端我使用 postgres 9.3。我的数据库脚本重新创建问题:
CREATE DATABASE world;
CREATE TABLE city
(
id integer NOT NULL,
name text NOT NULL,
countrycode character(3) NOT NULL,
district text NOT NULL,
population integer NOT NULL,
CONSTRAINT city_pkey PRIMARY KEY (id)
);
CREATE TABLE country
(
id integer NOT NULL DEFAULT nextval('hibernate_sequence'::regclass),
code character(3) NOT NULL,
name text NOT NULL,
continent text NOT NULL,
region text NOT NULL,
surfacearea real NOT NULL,
indepyear smallint,
population integer NOT NULL,
lifeexpectancy real,
gnp numeric(10,2),
gnpold numeric(10,2),
localname text NOT NULL,
governmentform text NOT NULL,
headofstate text,
capital integer,
code2 character(2) NOT NULL,
CONSTRAINT country_pkey PRIMARY KEY (id),
CONSTRAINT country_continent_check CHECK (continent = 'Asia'::text OR continent = 'Europe'::text OR continent = 'North America'::text OR continent = 'Africa'::text OR continent = 'Oceania'::text OR continent = 'Antarctica'::text OR continent = 'South America'::text)
);
CREATE TABLE countrylanguage
(
countrycode character(3) NOT NULL,
language text NOT NULL,
isofficial boolean NOT NULL,
percentage real NOT NULL,
CONSTRAINT countrylanguage_pkey PRIMARY KEY (countrycode, language)
);
我的 roo 脚本如下:
// Spring Roo 1.3.1.RELEASE [rev 8cb81a3] log opened at 2016-01-10 14:01:09
project --topLevelPackage org.world --projectName world --java 7 --packaging JAR
// Spring Roo 1.3.1.RELEASE [rev 8cb81a3] log closed at 2016-01-10 14:01:11
// Spring Roo 1.3.1.RELEASE [rev 8cb81a3] log opened at 2016-01-10 14:08:38
jpa setup --database POSTGRES --provider HIBERNATE --databaseName world --hostName localhost --userName postgres --password postgres
database introspect --schema public
database reverse engineer --schema public --package ~.domain
focus --class ~.domain.City
finder list
finder add --finderName findCitysByPopulationLessThan
web mvc setup
web mvc all --package ~.web
web mvc finder all
之后我启动应用程序。单击按人口查找城市的链接时,我收到了前面提到的错误,有人可以帮忙吗?甚至不确定从哪里开始调试...