-none- 2007-08-15 - By Andvar Woo
Back You can refer to the Struts doc. The easiest way is to use the struts2-blank-2 (See http://ank-2.ora-code.com).0.9.war as a start. you can find it from the http://struts.apache.org You'd better download a struts-2 (See http://uts-2.ora-code.com).x.all.zip from the download pages. Hope that helps,good luck. 2007/8/16, meisam sarabadani <meisam.sarabadani@(protected)>: > > Does anybody know how to configure struts on eclipse and build anew > project > by struts in eclipse ? > > On 8/16/07, red phoenix <rodphoenix@(protected)> wrote: > > > > For general Java class,we can make construction function,like this: > > public class test{ > > String a; > > public test(String a){ > > this.a=a; > > } > > } > > > > I don't know if I can do it like above code under struts2 action,for > some > > reason,I want to initialize some variable and assign some value to > it,like > > follows: > > public class MyClass extends ActionSupport{ > > private ....; > > public MyClass(SomeType s){ > > //make some common operaction,such get session and so on,because > I > > want to run them only once > > } > > public String execute() throws Exception { > > .... > > } > > public String .....{ > > } > > ... > > } > > > > I can successly compile above code,but when I run above code,it will say > > error: > > 1)MyClass action error > > 2)java.lang.NullException because some code in MyClass(SomeType s) > > > > When I remove the code in the MyClass(SomeType s) into execute() > > function,it > > can run well. I am puzzle with it! Anybody could tell me how to do > > it? An > > example is better. > > > > Thanks, > > phoenix > > > > > > -- > Appreciated much, > > Meisam Sarabadani > IBM Student Ambassador > Vice president II, IT Society > Multimedia University, Cyberjaya Capmus > -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- > "The day the Lord created hope was probably the same day he created > Spring." Bern Williams. > -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --- >
|
|