JSP once defeated ASP, PHP at the speed at speed, but JSP did not have much innovation. Code and page mixing, making IDE difficult to take care. When dealing with some complicated links, it is more hands to be. Structure and JSP similar ASP.NET With its server-side control programming and data binding concepts, let developers are likely to be programmed with VB. It can be written like this! In fact, this is just a transformation from programming. Tell the event on the browser in the Server to reside in the session. So how is Java implementation? I have conceived two programs to achieve:
1. Like ASP.NET, use TAG replacement to work.
2. Develop JSP, use Taglib to implement server-side controls.
Program 1 requires a good analysis of HTML. The advantage is flexible, you can use the existing HTML editing tool.
Program 2 requires Taglib to allow any properties, which is expected to be JSP2.0. The advantage is compatible with the current JSP, and can take advantage of Taglib nested and loop.
I have tried to write some prototypes to implement the program 1. It is found that the effect is good, but it also needs considerable efforts. Then the Java enthusiasts on the Internet are not lonely? Let's take a look:
JSF (JavaServer Faces) http://sourceforge.net/projects/tapestry/
The original SUN experts have long been busy, but the genius only set a great norm, throwing the manufacturer to the five flowers. Don't guess, use JSP Taglib. With Sun's influence, there should be Opportunity to see IDE, I hope not too late.
Tapestry http://sourceforge.net/projects/tapestry/
The open source project on this SourceForge looks active, 2.3beta1 version is relatively cumbersome. 2.4alpha1 simplifies the configuration, but it is not stable, see Demo recommendation 2.3. From the implementation method, look at the similar program 1, do not like JSP And XSL's art may be very happy. SourceForge has a lot of its auxiliary projects, one of which is an Eclipse plugin, it seems that it is not far away. The following is a simple example of displaying the current time:
HOME.HTML:
=================================================================================================================================================================================
hEAD>
This Application Demonstrates Some Dynamic Behavior Using TapeStry Components.
The current date and time is: here to refresh.
body>
html>
HOME.JAVA:
=================================================== package tutorial.SIMPLE;
Import java.util.date;
Import net.sf.tapestry.html.baSepage;
/ **
* @Version $ ID: Home.java, V 1.9 2002/11/27 17:58:58 hship eXP $
* @Author Howard Lewis SHIP
*
** /
Public Class Home Extends Basepage
{
Public Date getcurrentdate ()
{
Return new Date ();
}
}
=================================================================================================================================================================================
Echo http://www.nextapp.com/products/echo/
This little thing is only 1.0beta3, but its demo makes me a lot of water. Operating the window on the browser actually doesn't have something different from writing a normal program Swing program, and can also refresh. If the front two frames still residue Struts The taste, then echo let us completely return to OO: Write servlet with Swing. Currently I haven't seen IDE support, if Borland is willing, let JBuilder support it is easy. SourceForge has two echo related projects ECHOPOINT And Marsh provides more Echo controls that make you dlow, interested friends can go see. Below is an example of HelloWorld
HelloWorldServlet:
=================================================================================================================================================================================
Import nextApp.echo.contentpane;
Import nextapp.echo.echoinstance;
Import nextapp.echo.label;
Import nextapp.echo.window;
Import nextapp.echoservlet.echoserver;
Public class helloworldservlet extends echoserver {
/ / Return to a new instance for the user
Public echoinstance newinstance () {
Return new helloworld ();
}
}
Class HelloWorld Extends echoinstance {
// Call the init method when the user is first accessed. Return to the content you see by the user browser
Public window init () {
Window window = new window ();
// Components can't be placed directly under WINDOW, you must add ContentPane Content = New ContentPane ();
WINDOW.SETCONTENT (Content);
Label label = new label ("Hello, World!");
Content.add (label);
Return window;
}
}
=================================================================================================================================================================================
Do not ask, the world is so wonderful. Think about the completion of some complex functions on the Web, the background program, the front desk script, one can not be less. Web Componets have made us see hope, complex operation Give it to the frame to complete, let us return to object-oriented OO world. But you want to see that too much event will cause server performance to decline due to excessive dependency and browser scripts. However, because of servlet, we can Traditional development methods are also used. And with the improvement of network performance and the support of IDE, Web development will become efficient and enjoyable.