44import org .tinystruct .ApplicationContext ;
55import org .tinystruct .ApplicationException ;
66import org .tinystruct .system .ApplicationManager ;
7- import org .tinystruct .system .Dispatcher ;
87import org .tinystruct .system .Settings ;
8+ import org .tinystruct .system .annotation .Action ;
99
1010import java .util .Date ;
1111
@@ -14,42 +14,42 @@ public class hello extends AbstractApplication {
1414 @ Override
1515 public void init () {
1616 // TODO Auto-generated method stub
17- this .setAction ("praise" , "praise" );
18- this .setAction ("say" , "say" );
19- this .setAction ("smile" , "smile" );
20- this .setAction ("date" , "currentDate" );
21- this .setAction ("setdate" , "setCurrentDate" );
22- this .setAction ("stable" , "stable" );
2317 }
2418
2519 @ Override
2620 public String version () {
2721 return "1.0" ;
2822 }
2923
24+ @ Action ("praise" )
3025 public String praise () {
3126 return "Praise to the Lord!" ;
3227 }
3328
29+ @ Action ("say" )
3430 public String say () {
35- if (null != this .context .getAttribute ("--words" ))
31+ if (null != this .context .getAttribute ("--words" ))
3632 return this .context .getAttribute ("--words" ).toString ();
3733
3834 return "Invalid parameter(s)." ;
3935 }
4036
37+ @ Action ("setdate" )
4138 public Date setCurrentDate (Date date ) {
4239 return date ;
4340 }
4441
45- public Date currentDate (){
42+ @ Action ("date" )
43+ public Date currentDate () {
4644 return new Date ();
4745 }
4846
47+ @ Action ("stable" )
4948 public boolean stable (boolean x ) {
5049 return x ;
5150 }
5251
52+ @ Action ("smile" )
5353 public String smile () {
5454 return ":)" ;
5555 }
0 commit comments