allwiki首页  
天下维客 你可以修改的网络知识库
首页最近更改优秀条目专题展示电脑科技词典软件学习网络知识电脑安全明星时尚天下百科
 

JSF Quickstart With MyEclipse---7

天下维客,你可以修改的网络知识库

Jump to: navigation, search

Running the Application

In this section we will quickly show what our new application looks like when its running.

We will use MyEclipse to deploy our application to Tomcat 5 and then launch the server so we can run the application. Complete details in how to set up an application server and deploy to it within MyEclipse is available in the Application Server Quickstart. For the purposes of this example, we're going to assume that Tomcat 5 has already been configured for our use and we simply need to deploy our application to it. Deployment is done by the Manage Deployments dialog, which can be activated from the project's context menu by right-clicking on the project in the Package Explorer View and selecting MyEclipse > Add / Remove Deployments... The Manage Deployments dialog, shown in Figure 19, will be launched. To add a deployment, simply click the Add button and the New Deployment wizard, shown in Figure 20, will be launched.

Image:2a-run.gif

Figure 19 - Manage Deployments Dialog

Image:1-run.gif

Figure 20 - New Deployment Wizard

Select Tomcat 5 as the server, exploded archive as the deployment type, and select Finish as shown in Figure 20. After the wizard completes execution, the Deployment Manager will show that the deployment was successful. This is depicted in Figure 21. Now that the deployment has completed, you can select OK to close the dialog.

Image:2-run.gif

Figure 21 - Successful Deployment

At this point the Tomcat 5 server can be started by selecting Start from the Tomcat 5 management menu from the main Eclipse toolbar, as shown in Figure 22, below.

Image:3-run.gif

Figure 22 - Starting Tomcat 5

The output from the server log will be redirected to the Eclipse Console View. From the log shown in Figure 23, it is evident that the sever started successfully and that our example application was deployed.

Image:4-run.gif

Figure 23 - Tomcat 5 Startup Log

Once Tomcat 5 is running, we can test it by opening the MyEclipse Browser View. This can be done from the Open View dialog that is accessed by selecting Window > Show View > Other... then selecting the MyEclipse Web Browser View, as shown in Figure 24.

Image:Open-browser.gif

Figure 24 - Opening the Web Browser View


In the browser's address bar, enter <a href="http://localhost:8080/JSFLoginDemo/userLogin.faces" class="external free" target="_blank" title="http://localhost:8080/JSFLoginDemo/userLogin.faces" rel="nofollow">http://localhost:8080/JSFLoginDemo/userLogin.faces</a> to activate the example application, as shown in Figure 25.

Image:5a-run.gif

Figure 25 - Accessing the Example Application


You can try logging in with incomplete or incorrect credentials and see how the error message is displayed, as in Figure 24. Or, you can log in with the username and password both set to 'myeclipse' (without the quotes) to see the application redirect to the "success" page, as shown in Figure 26.

Image:7a-run.gif

Figure 26 - Invalid Login

Image:9a-run.gif

Figure 27 - Successful Login


We see our navigation rules kick in as we are validated and directed to the userLoginSuccess.jsp page where our name is displayed. While this application is certainly simple, it does convey the basics of developing a JSF application using MyEclipse.

Summary

In this demo we took a look at developing a simple JSF application using MyEclipse Enterprise Workbench. In the current release of MyEclipse (3.8.2) support for JSF is centered around project capabilities as well as strong editor (XML, JSP, etc.) support with auto-completion and validation. Moving forward, as early as MyEclipse 3.9, we will start to integrate extended JSF tooling support. Eventual JSF tooling will provide visual faces-config.xml editing along the lines of our struts-config.xml designer and integration of a visual JSP designer with support for drag and drop JSF building.

While this support will not all be immediately available in MyEclipse 3.9, more and more JSF support and extended tooling will be integrated into the MyEclipse development environment to provide a more comprehensive set of tools going forward.

This concludes your introduction to JSF. Additional Quickstart documents are available that introduce working with Web Projects, editing, application server configuration, enterprise application projects and database development.

Personal tools
工具
金银币拍卖 金币拍卖预展  金银币网店 熊猫金银币 生肖金银币