Typically these were peoples first experience with making web pages so consisted of My Home Page sites and company marketing information. Afterwards Perl and C were languages used on the web server to provide dynamic content.
These were known as CGI server side applications. Notice that the web server also is connected to a database. JSP is easy to learn and allows developers to quickly produce web sites and applications in an open and standard way. JSP is based on Java, an object-oriented language. JSP offers a robust platform for web development.
Main reasons to use JSP Multi platform2. Component reuse by using Javabeans and EJB. Advantages of Java. This means you are never locked into one vendor or platform. HTML and graphics displayed on the web browser are classed as the presentation layer. The Java code JSP on the server is classed as the implementation.
By having a separation of presentation and implementation, web designers work only on the presentation and Java developers concentrate on implementing the application. JSP may have slightly higher learning curve. Both allow embedded code in an HTML page, session variables and database access and manipulation.
Whereas ASP is mostly found on Microsoft platforms i. These JSP tags can contain Java code. The JSP file extension is. The JSP engine parses the. It then compiles the source file into a class file, this is done the first time and this why the JSP is probably slower the first time it is accessed.
Any time after this the special compiled servlet is executed and is therefore returns faster. Web browser Request2. Parse JSP file5.
Now a window opens asking for the server location. Now, click on the Browse button and find the server location where you have stored the Apache Tomcat. Note that you need to provide the path up to the bin directory of Tomcat Server.
After providing the server path you will see two more options for username and password. Now a window is generated containing the default index. Note: By default, the project has been created with the Compile on Save feature enabled, so you do not need to compile your code first in order to run the application in the IDE. The IDE opens an output window that shows the progress of running the application. Look at the HelloWeb tab in the Output window.
In this tab, you can follow all the steps that the IDE performs. If there is a problem, the IDE displays error information in this window. The IDE opens an output window showing the server status. Look at the tab in the Output window with the name of your server. Important: If the GlassFish server fails to start, start it manually and run the project again.
You can start the server manually from the Services window, by right-clicking the server node and selecting Start. The server output window is very informative about problems running Web applications. The index. Note that the browser window may open before the IDE displays the server output. Enter your name in the text box, then click OK. The response. When I click the OK button for index. What error messages are there? What JDK does your project use?
What server? JDK 7 requires GlassFish 3. The server version is in the Run category. This overwrites the value you passed in the index. Delete the value attribute. Is the server running? Was the application deployed? If the server is running and the application was deployed, are you getting an org. JasperException: java. This usually means that a value in your code is not initialized correctly. In this tutorial, it means that you probably have a typo somewhere in a property name in your JSP files.
Remember that property names are case-sensitive! Send Feedback on This Tutorial. This concludes the Introduction to Developing Web Applications tutorial. This document demonstrated how to create a simple web application using NetBeans IDE, deploy it to a server, and view its presentation in a browser.
0コメント