Running 3T

Now we recommend you stop GlassFish and restart NetBeans to ensure all changes made previously are up-to-date in the IDE. The final step is to run the 3T application:

Running 3T

This should result in considerable output culminating in deployment of the 3T application to the GlassFish server:

Running 3T

Note that the final WARNING in the GlassFish Server 4.0 output can be ignored; this is a known issue when deploying an application to the root context from within NetBeans.

The final action by NetBeans will be to open your default browser to the welcome page displayed in Chapter 1, Preparing Your Development Environment. You should note that the URL in the browser will now be:

http://localhost:8080/

Instead of the original:

http://localhost:8080/task-time-tracker

This is due to the <context-root>/</context-root> property in glassfish-web.xml, which defines the root of the web application path. The 3T web application is now deployed to the context root and no prefix is required to reach the deployed 3T application.

You can now try to load a mapped URL such as /ttt/company/findAll.json. Enter this in the browser as shown and hit the Enter key. You should see the following result:

Running 3T

This message is coming from the UserInSessionInterceptor we implemented in the last chapter. The session check fails as we are not currently logged on, returning the preceding JSON message to the browser. The logger.info message in the class should also be visible in the GlassFish output:

Running 3T

You can now try a logon action with parameters as shown in the following screenshot:

Running 3T

This result may surprise you. The request URL is mapped to the SecurityHandler.logon method, which is defined with method = RequestMethod.POST in the @RequestMapping annotation. This restricts access to this method to POST requests only, while the URL-encoded parameters submitted by the browser is a GET request. The GlassFish 405 HTTP status message is the result. In Chapter 10, Logging On and Maintaining Users, we will be implementing the logon process using the appropriate POST request.

You should note that all handler URLs will be accessed by AJAX calls from the Ext JS 4 application, which will be developed in subsequent chapters. You will never see these URLs in the browser as shown previously.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.73.127