3

I am starting on Springsource using Spring Roo.

Q1. Am I correct to say that Spring Roo automates a lot of tedium out of Spring?

I am asking that because when I follow non-roo tutorials on Spring, I am reading that I have to perform a significant amount of configuration and stubs which would have been done by roo. I don't see why, prior to roo, would Spring help reduce my work load.

Q2. Is it necessary to define entities using the namespace ~.domain.whatever. Is it necessary to have "domain"? Can I do

entity --class ~.profile.PostalAddress

? Is Spring sensitive to the word "domain"?

Q3. I would like to define an entity

Employee { long id, string name, string project, date startdate}

I would like to bind Employee to a presentation panel where

  • id is a hidden field,
  • name is displayed non-editable field,
  • project is displayed editable field populated with the current value in the db,
  • startdate is not even sent to the browser.

How do I accomplish that in Roo? If I cannot do that in Roo, is there a way I could muck around with the Spring generated innards to accomplish it and how easy would it be?

Q4. Spring roo generates a standard template web interface. But I do not wish to use the interface. I just want roo to generate RESTful panels for me, which I could associate with a GWT menu item.

The reason is I need to use GWT/SmartGWT navigation widgets and when the appropriate data manipulation item is called thro gwt/smartgwt, I would like to call/enable that Spring generated data panel RESTfully.

How do I get roo, or subsequently Spring, to generate a RESTful data panel for each of my entity without using Spring or roo's generated (useless/unattractive) default navigation side panes? Would I have to manually modify those roo generated files? If so, how and what?

In short, I want to use the convenience of roo's help in generating lots of presentation-validation-model bound modules but use my own GWT/Smart GWT to navigate to them. I am NOT asking about roo+gwt.

4

2 に答える 2

1

Q1: Roo が登場する前は、Spring アプリケーション用にかなりの数の構成ファイルを作成する必要があったことは事実です。ただし、Spring がなければ、さらに多くの構成を作成する必要があり、さらに悪いことに、すべてを結合する Java コードを作成する必要があります。

Q2: Roo は「ドメイン」という言葉にとらわれません。パッケージは好きな方法で呼び出すことができます。個人的には、ドメイン クラスのサブパッケージ「モデル」を好みます。

Q3 と Q4 については何も言えません。申し訳ありません。

于 2010-10-07T12:32:48.230 に答える
0

警告 - 私は ROO の専門家ではありません。自分で始めたばかりです。

Q3:

ここですべてを行う方法を見つけることができます: http://static.springsource.org/spring-roo/reference/html/base-web.html#jsp-views

ID : サポートするには、標準の jstl タグをインポートする必要があります<frm:hidden>(Roo にはデフォルトでこれがありません)。

Name : Name フィールドをプレーン テキストとして表示することも、無効なテキスト ボックスとして表示することもできます。後者の場合は、タグに disabled=true を追加できると思います。

Project : Roo は Project に必要なことをすぐに実行します (ただし、"Project" が多対多関係の別のエンティティである場合は、デフォルトで選択ボックスが作成され、可能なすべてのプロジェクトと現在のプロジェクトが含まれます。選択済み)

StartDate : roo が生成したタグに "render='false'" を設定すると、そのフィールドの html も出力されません。

どのような場合でも、タグの Z フィールドを に変更しない限り、Roo は入力フィールドを書き換えますz="user-managed"
私はおそらく元の ROO タグを保持し、それを変更してrender="false" z="user-managed"、その下に独自のタグを追加して、本当にやりたいことを行うでしょう。


Q4

GWT に詳しくありませんが、GWT について考えたことはありますか?roo web gwt

于 2013-02-08T01:04:49.803 に答える