Well said. You hit it on the head with "a major advantage of ASP.NET is static compile-time checking." If that were possible in JSP, it would save me a lot of time. :)
peace, Joe > -----Original Message----- > From: John Yu [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 04, 2002 7:21 PM > To: Struts Users Mailing List > Subject: Re: FW: ASP.NET - similar to Struts? > > > I think what neal was saying is: > > In ASP.NET, the controllers (C#) *push* the data into the > custom tags while > in Struts/JSP, the taglibs *pull* data from the request context. > > In actually fact, this push vs pull comparison is not that > clear cut. In > both cases, both push and pull are happening. > > The major difference is that in ASP.NET, the language > provides explicit > syntax to do the value-passing (controller->view). The > language allows your > controller to refer to the view elements as objects in > "form.field(x) = 'xyz'". > > While in Struts/JSP, the value-passing is achieved by using key-value > association. Consider: > > request.setAttribute("myOutput", outputStr); // in action > > <bean:write name="myOutput"/> // in JSP > > The connection between the controller and the view is the key > "myOutput". > You use a key to associate a value to a view element. > > In other words, ASP.NET pushes this value-passing mechanism > down to the > language level while Struts/Servlet/JSP doesn't. All syntactical and > "religious" differences aside, a major advantage of ASP.NET is static > compile-time checking. > -- > John > > > At 05:15 am 05-09-2002, you wrote: > >If I understand the question properly, we also consider it > good practice > >to have the control layer set the values before forwarding to the > >presentation page. In Struts, the control layer is most > often represented > >by the Action. We encourage people to always link to an Action first > >before forwarding out to a JSP. > > > >Struts uses ActionForm JavaBeans to carry the values that > will populate > >the JSP form. > > > >I think it would be interesting to boil down what Struts, > ASP.NET, and the > >other framework do to generic case studies. I put some > preliminary notes here: > > > >http://husted.com/struts/usecases.html > > > >-Ted. > > > >neal wrote: > > > >>Oops .. in paragraph 3 (QUESTION) ... the last sentence > should actually > >>read: > >>Rather, in the ASPX file you would have (a custom tag - > aspx:field name="x" > >>/>) and then in the *ASPX.CS* file you would set the value > of the field: > >>form.field(x) = 'xyz'. > >>-----Original Message----- > >>From: neal [mailto:[EMAIL PROTECTED]] > >>Sent: Wednesday, September 04, 2002 1:23 PM > >>To: Struts Users Mailing List > >>Subject: ASP.NET - similar to Struts? > >> > >>I noticed a few similarities to ASP.NET in Struts (from a > 30,000 foot > >>level). This gave way to a few questions. I am also > curious to know what > >>anyone else thinks of this comparison: > >>BACKGROUND > >>In ASP.NET (for those not familiar) there is now seperation > of code form > >>content, similar to thatr achieved in JSP model 2. They do it via > >>"CodeBehind". Effectively, every .ASPX file (new ASP > extension) comes can > >>have a .ASPX.CS compliment file. This CS (C-sharp) file is > effectively then > >>the same thing as the classes written to facilitate the > controller for > >>various JSPs in an MVC model. > >>QUESTION > >>This got me to thinking....being new to Struts I don't yet > know the answer > >>to this question, but in ASP.NET it is considered 'good > practice' to set the > >>values of the ASP you will forward to, in its compliment > ASPX.CS file. Ok, > >>so say that you are editing someone's registration info, the info is > >>populated in the form. You wouldn't use tags to grab the > data and set it > >>into the form field. Rather, in the ASPX file you would > have (a custom > >>tag - aspx:field name="x" />) and then in teh aspx file you > would set the > >>value of the field: form.field(x) = 'xyz'. > >>What I am wondering is ... is there a similar mechanism in > Struts? .... or > >>must you pull the values via tag (sort of a pull vs push approach it > >>seems)... > >>Thanks. > >>Neal > > > >-- > >John Yu Scioworks Technologies > >e: [EMAIL PROTECTED] w: +(65) 873 5989 > >w: http://www.scioworks.com m: +(65) 9782 9610 > > > >Scioworks Camino - "Don't develop Struts Apps without it!" > >Copyright (c) 2002 John Yu/Scioworks Technologies. All > rights reserved. > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

