answersLogoWhite

0

What is jsp page technology?

User Avatar

Anonymous

14y ago
Updated: 8/19/2019

Java Server Pages have become an integral part of any J2EE application. They are used extensively because they can combine the features of HTML and Java. The difficulty level of JSP is half-way between HTML and pure Java. For simple tasks like displaying the current date, you write a normal HTML page and add only a small amount of Java as a scriptlet. For big tasks like processing a shopping cart, you use JSP as the mediator between the Web form and a component (Ex: Servlet) that has all the processing logic.

CGI, Perl, Active Server Pages etc were all the predecessors of Java Server Pages. Am not saying that the JSP Technology was built based on these technologies but it is safe to say that, the JSP Technology was created to overcome many of the shortcomings in the above mentioned technologies. Though the ASP technology is a web server scripting champion and is used very widely, the only problem is the Runs only in Windows Attitude of the technology. Unlike ASP, JSP has equivalent if not better features and can run in any environment making it an invaluable tool for enterprise application developers who don't want to be tied to the limitation of the system running only in Windows.

Not only does JSP run on all major platforms, but the JavaBeans used by these JSPs run on all major platforms as well.

JSP competes directly with ASP. In fact, you would be forgiven if you thought it was a copy. Sun took the same approach to JSP as it did with Java. Sun borrowed the syntax of its best competitor (ASP for JSP and C++ for Java) tweaked it a little, but built everything under the hood from scratch. Java syntax comes from C++, but it works on all platforms with no portability issues like C++ for the developer. Similarly, the JSP structure comes from ASP. The look and feel, and even some syntax is the same. However, ASP primarily uses Microsoft's versatile VBScript, while JSP uses the more powerful and portable Java and JavaScript.

How Does JSP Work?

If you remember the initial chapters in this series, you would remember the fact that JSP Pages get converted or rather Translated into Servlets before execution. Kudos to you if you remembered it. The JSP container parses the JSP source and converts the entire JSP page (HTML becomes strings and Java source code embedded in a JSP page gets copied into methods) into a Java servlet class. The HTML text is converted into a bunch of out.println statements in the order encountered. Finally, the container compiles this class into Java bytecodes. This Servlet is invoked by the Server in order to finish displaying the contents on the web browser.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What kind of technology is JSP?

JSP, or JavaServer Pages is a technology that creates different web page forms through in various document types, including HTML and XML. It is a technology used by software developers and uses Java programming language.


Can I prevent the creation of a session in a JSP page?

Yes you can. Use the below line in your JSP page to accomplish it. <%@ page session="false" %>


What are the Implicit object in JSP?

The implicit objects in a JSP page are:requestresponsepageContextsessionapplicationoutconfigpage


What are the JSP lifecycle methods?

The 3 life cycle methods in a JSP page are:jspInit() - Called when the JSP page is initializedjspService() - Called everytime a request/response is received/submittedjspDestroy() - Called when the JSP is no longer required


When you forward a JSP page which built-in JSP object goes out of scope?

application


Is it possible to include a doc file in a JSP page?

Yes. You can embed spreadsheets, pdfs and word documents in a JSP Page


How many page directive can use in a single JSP?

There is no limit as such. You can use one or more Page Directives in a JSP but you cannot have duplicates


How does a JSP page handle run-time exceptions?

You can use the errorPage attribute of the page directive. If this attribute is defined in a JSP page, when a run time exception is encountered, the control will be transferred to this JSP page. This error page can access details of the Exception from the request and use it to display a logical message to the user.


What is the purpose of page directive in JSP?

The Page Directive is one of the important components of any JSP Page. It can help us define page specific properties like Buffer size or location of an error page etc A JSP page, and any files included via the include directive, can contain one or more page directives but no duplicates. The JSP container will apply all the attributes to the page. The position of these page directives is irrelevant, but it is good practice to keep them together at the top of the page. (So that we can identify them easily)


Which one is better from jsp and asp?

I would choose JSP because JSP is a open source technology and is free whereas ASP is a proprietary technology and is paid. Features wise, both JSP and ASP are equivalent and can compete with one another feature by feature.


How do you create master page in jsp?

how to create a master page in java


How you can display servlet page in jsp page?

You cannot. You display JSP Pages using the help of Servlets. Servlets are of the background classes and you cannot display them