Relationship
============
1.m:m use "field set"
(one Pizza can have many Toppings & one Topping can be applied to many Pizzas)
~.domain.Pizza roo> field set --fieldName toppings --type ~.domain.Topping
2.m:1 use ""field reference"
(one Pizza can have one base & one base can be applied to many Pizzas)
~.domain.Pizza roo> field reference --fieldName base --type ~.domain.Base
3.Automatic JSON support, including in Spring MVC applications
curl -v -H 'Accept: application/json' -X GET http://localhost:8080/petclinic/owners/
Wednesday, 31 August 2011
Thursday, 25 August 2011
JSP Custom Tags
1.Make Java public Class "MyTag"
2.Declare the "MyTag" class under file MyTag.tld
3.In JSP, define the <%@ taglib prefix="tagtool" uri="/WEB-INF/tlds/MyTag.tld" %>
& start to use it.
2.Declare the "MyTag" class under file MyTag.tld
3.In JSP, define the <%@ taglib prefix="tagtool" uri="/WEB-INF/tlds/MyTag.tld" %>
& start to use it.
Wednesday, 24 August 2011
ROO project
Task 2 - point to list.jsp & delete.jsp
Task 1 - point to create.jsp & show.jsp
a.Create new Client Form
http://localhost:8080/simple/clients?form
Form:-
1.need (method = RequestMethod.GET) & (method = RequestMethod.POST)
2.POST need (@ModelAttribute("reservation") Reservation reservation,
BindingResult result, SessionStatus status) AS parameter
3.JSP need modelAttribute="reservation"
b.Show Client
http://localhost:8080/simple/clients/2
Answer :- change views.xml +
Task 1 - point to create.jsp & show.jsp
a.Create new Client Form
http://localhost:8080/simple/clients?form
Form:-
1.need (method = RequestMethod.GET) & (method = RequestMethod.POST)
2.POST need (@ModelAttribute("reservation") Reservation reservation,
BindingResult result, SessionStatus status) AS parameter
3.JSP need modelAttribute="reservation"
b.Show Client
http://localhost:8080/simple/clients/2
Answer :- change views.xml +
username : ${client.username}
Wednesday, 17 August 2011
Use Derby
1.For the sake of low memory consumption and easy configuration,chosen Apache Derby
as database engine.
2.For testing purposes, the client/server mode is more appropriate because it allows you to inspect and edit data with any visual database tools that support JDBC. Example, the Eclipse Data Tools Platform (DTP).
3.To start the Derby server in the client/server mode, execute the startNetworkServer script in the bin directory.
4.Under ij
5.connect 'jdbc:derby://localhost:1527/vehicle;create=true' ;
as database engine.
2.For testing purposes, the client/server mode is more appropriate because it allows you to inspect and edit data with any visual database tools that support JDBC. Example, the Eclipse Data Tools Platform (DTP).
3.To start the Derby server in the client/server mode, execute the startNetworkServer script in the bin directory.
4.Under ij
5.connect 'jdbc:derby://localhost:1527/vehicle;create=true' ;
Git usage
To obtain a copy of the source:
From the bash command line, you can use the command
git clone git://git.springsource.org/spring-security/spring-security.git
Git Wiki
http://git-scm.com/download
Git-1.7.6-preview20110708.exe of msysgit (Git for Windows)
git
github
spring git
Eclipse GIT
If
git clone git://site/xxx/abc.git
having error fatal: unable to connect a socket (Invalid argument)
then use (http instead)
git clone http://site/xxx/abc.git
From the bash command line, you can use the command
git clone git://git.springsource.org/spring-security/spring-security.git
Git Wiki
http://git-scm.com/download
Git-1.7.6-preview20110708.exe of msysgit (Git for Windows)
git
github
spring git
Eclipse GIT
If
git clone git://site/xxx/abc.git
having error fatal: unable to connect a socket (Invalid argument)
then use (http instead)
git clone http://site/xxx/abc.git
Maven commands
mvn –version
mvn install
mvn clean install
(remove any pre-built binaries and then install the artifact)
mvn jetty:run-exploded --from ROO GWT
mvn [plugin-name]:[command-name]
================================
mvn dependency:tree
mvn dependency:copy-dependencies
ROO
===
dependency add --groupId org.springframework.integration --artifactId spring-integration-file --version 2.0.0.RELEASE
perform package
dependency remove --groupId org.springframework.integration --artifactId spring-integration-file --version 2.0.0.RELEASE
perform command --mavenCommand install
Phase Description
validate Runs a sanity check on the project itself
compile Compiles source code
test Runs the compiled test classes (delegating to a particular unit testing plugin runner, like jUnit or TestNG)
package Produces an artifact from the compiled code and classpath resources and stores it in the target folder, at the root of the project
integration-test Process and deploy the packaged artifact into an integration testing environment
verify Run checks to confirm that the package is valid
install Installs the packaged artifact in your local repository. Your local repository is a folder where all the downloaded dependencies are kept and cached. Subsequent builds that try to resolve a dependency already in the cache will not redownload the dependency, instead using the one in the local repository. Normally, it's in your home directory, under .m2, in a folder called repository. Thus, on my system, this would be /home/jlong/.m2/repository
deploy Copies the final artifact to another environment. Typically, a shared server so that different teams can share a shared dependency.
mvn install
mvn clean install
(remove any pre-built binaries and then install the artifact)
mvn jetty:run-exploded --from ROO GWT
mvn [plugin-name]:[command-name]
================================
mvn dependency:tree
mvn dependency:copy-dependencies
ROO
===
dependency add --groupId org.springframework.integration --artifactId spring-integration-file --version 2.0.0.RELEASE
perform package
dependency remove --groupId org.springframework.integration --artifactId spring-integration-file --version 2.0.0.RELEASE
perform command --mavenCommand install
Phase Description
validate Runs a sanity check on the project itself
compile Compiles source code
test Runs the compiled test classes (delegating to a particular unit testing plugin runner, like jUnit or TestNG)
package Produces an artifact from the compiled code and classpath resources and stores it in the target folder, at the root of the project
integration-test Process and deploy the packaged artifact into an integration testing environment
verify Run checks to confirm that the package is valid
install Installs the packaged artifact in your local repository. Your local repository is a folder where all the downloaded dependencies are kept and cached. Subsequent builds that try to resolve a dependency already in the cache will not redownload the dependency, instead using the one in the local repository. Normally, it's in your home directory, under .m2, in a folder called repository. Thus, on my system, this would be /home/jlong/.m2/repository
deploy Copies the final artifact to another environment. Typically, a shared server so that different teams can share a shared dependency.
Wednesday, 10 August 2011
Can not find the tag library descriptor for "http://java.sun.com/portlet"
To fix add pluto-taglib.jar
===========================
[!-- To solve porlet taglibs problem --]
[dependency]
[groupId]org.apache.portals.pluto[/groupId]
[artifactId]pluto-taglib[/artifactId]
[version]2.0.0[/version]
[type]jar[/type]
[scope]compile[/scope]
[/dependency]
Need Pluto
Get Pluto
===========================
[!-- To solve porlet taglibs problem --]
[dependency]
[groupId]org.apache.portals.pluto[/groupId]
[artifactId]pluto-taglib[/artifactId]
[version]2.0.0[/version]
[type]jar[/type]
[scope]compile[/scope]
[/dependency]
Need Pluto
Get Pluto
cvc-complex-type.4: Attribute 'version' must appear on element 'portlet-app'.
Before
======
[portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"]
Fix
===
[portlet-app
version="2"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"]
======
[portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"]
Fix
===
[portlet-app
version="2"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"]
Tuesday, 9 August 2011
Fixed Costs vs Indirect Costs
Fixed costs
Fixed costs can be grouped in three types:These costs include the following expense items: Agency fee, Crew cost, Vessel depreciation, Vessel insurance, Vessel interest, Vessel’s Maintenance & repair, Oil, Canal Fee, Charter hire, Dry docking depreciation, Fleet Administration, Admin Expenses and GI
Indirect costs
Expenses that are related indirectly to the container and does not hold the container data e.g.: Shifting, Hatching
Fixed costs can be grouped in three types:These costs include the following expense items: Agency fee, Crew cost, Vessel depreciation, Vessel insurance, Vessel interest, Vessel’s Maintenance & repair, Oil, Canal Fee, Charter hire, Dry docking depreciation, Fleet Administration, Admin Expenses and GI
Indirect costs
Expenses that are related indirectly to the container and does not hold the container data e.g.: Shifting, Hatching
Monday, 8 August 2011
Error message: "A script on this page is causing Internet Explorer to run slowly"
To Fix
======
To change this time-out value in Internet Explorer 4.0, 5.0, 6, 7, or 8, follow these steps:
Using a Registry Editor such as Regedt32.exe, open this key:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Styles
Note If the Styles key is not present, create a new key that is called Styles.
Create a new DWORD value called "MaxScriptStatements" under this key and set the value to the desired number of script statements. If you are unsure of what value you need to set this to, you can set it to a DWORD value of 0xFFFFFFFF to completely avoid the dialog.
By default the key doesn't exist. If the key has not been added, the default threshold limit for the time-out dialog box is 5,000,000 statements for Internet Explorer 4 and later.
Because the Internet Explorer 4.0, 5.0, 6, 7, and 8 time-out is based on the number of script statements executed, the time-out dialog box will not display during ActiveX control or database-access delays. Endless loops in script will still be detected.
======
To change this time-out value in Internet Explorer 4.0, 5.0, 6, 7, or 8, follow these steps:
Using a Registry Editor such as Regedt32.exe, open this key:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Styles
Note If the Styles key is not present, create a new key that is called Styles.
Create a new DWORD value called "MaxScriptStatements" under this key and set the value to the desired number of script statements. If you are unsure of what value you need to set this to, you can set it to a DWORD value of 0xFFFFFFFF to completely avoid the dialog.
By default the key doesn't exist. If the key has not been added, the default threshold limit for the time-out dialog box is 5,000,000 statements for Internet Explorer 4 and later.
Because the Internet Explorer 4.0, 5.0, 6, 7, and 8 time-out is based on the number of script statements executed, the time-out dialog box will not display during ActiveX control or database-access delays. Endless loops in script will still be detected.
Sunday, 7 August 2011
Receipe (1)
Grails
======
p.471 In web app, domain classes are first things to be defined, because represent data that is saved — in permanent storage system — it interacts with
controllers - representing data displayed in views.
======
p.471 In web app, domain classes are first things to be defined, because represent data that is saved — in permanent storage system — it interacts with
controllers - representing data displayed in views.
Subscribe to:
Posts (Atom)