1

While working on an ASP.NET project, I really liked the concept of a class for each page or webform, where I could write all the method and actions I want, and more importantly, the Page Load method.

Everyone says that we should avoid using scriplets, either in ASP or JSP.

And I suppose that the Page Load existed for us so that we don't use scriplets anymore.

Because I heard and read many times that we can't know when these scriplets will run, but in the Page Load method, we know exactly how the codes will run and how the page will be rendered.

But in JSP, as far as I know, we don't have this type of server-side class for each page.

Instead we have something called servelts, which everyone encourages to use.

But technically servlets are independent from the normal JSP pages.

So still, I'm using scriplets in my JSP pages, even though I'm trying to make them less as much as I could, but I still use some scriplets to check the Session and some URL parameters.

Isn't there a similar idea or approach to the Page Load (ASP) in JSP?

4

1 に答える 1

0

BalusC は、あなたがリンゴとオレンジを比較していると言ったのは正しかった. JSF は asp.net に対応して作成されました。( source @ 47 minutes) それは独立して成長したので、そこにあるさまざまなフレームワークやパラダイムをすべて調べてみるとよいでしょう。JSF は asp.net と同様に機能しますが、探索する価値のある代替手段がたくさんあります。.NET では、MVC4 を調べることができます。Java には Tapestry、Spring MVC、Seams などがあります。

wiki の比較から始めて、そこから始めます。ゲームのあなたの段階で、同じことをするためにさらに2つ試すよりも、1つを選んでそれに慣れようとします.

http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks#Java_2

于 2013-01-02T20:27:42.193 に答える