0% found this document useful (0 votes)
48 views2 pages

Q.what Is The Difference Between Forward and Send Redirect?

JSP directives are instructions processed during page compilation that set page attributes, include files, and specify tag libraries. Common directives include include, page, and taglib. JSP actions are executed at request time to include files, access beans, forward to other pages, and generate HTML. Common actions include include, useBean, setProperty, getProperty, and forward. Scriptlets contain Java code embedded in JSP pages that is inserted into the generated servlet. Declarations define variables for use in expressions and scriptlets. Implicit objects available in JSP include application, page, request, response, session, exception, out, and config which represent commonly used objects.

Uploaded by

Sonam Saxena
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views2 pages

Q.what Is The Difference Between Forward and Send Redirect?

JSP directives are instructions processed during page compilation that set page attributes, include files, and specify tag libraries. Common directives include include, page, and taglib. JSP actions are executed at request time to include files, access beans, forward to other pages, and generate HTML. Common actions include include, useBean, setProperty, getProperty, and forward. Scriptlets contain Java code embedded in JSP pages that is inserted into the generated servlet. Declarations define variables for use in expressions and scriptlets. Implicit objects available in JSP include application, page, request, response, session, exception, out, and config which represent commonly used objects.

Uploaded by

Sonam Saxena
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Q.what is the difference between forward and send Redirect? Ans: Both requestDispatcher.forward () and response.

sendRedirect () is used to redirect to new url.Forward is an internal redirection of user request within the web container to a new URL without the knowledge of the user (browser). The request object and the http headers remain intact. send Redirect is normally an external redirection of user request outside the web container. send Redirect sends response header back to the browser with the new URL. The browser sends the request to the new URL with fresh http headers. send Redirect is slower than forward because it involves extra server call. Q.Can I create XML pages using JSP technology? Ans: Yes, the JSP specification does support creation of XML documents. For simple XML generation, the XML tags may be included as static template portions of the JSP page. Dynamic generation of XML tags occurs through bean components or custom tags that generate XML output. Q.what are Directives? Ans: Directives are instructions that are processed by the JSP engine when the page is compiled to a servlet. Directives are used to set page-level instructions, insert data from external files, and specify custom tag libraries. Q.what are the different types of directives available in JSP? Ans: The following are the different types of directives: a. include directive : used to include a file and merges the content of the file with the current page b. page directive : used to define page specific attributes like scripting language, error page, buffer, thread safety, etc c. taglib : used to declare a custom tag library which is used in the page. Q.what are JSP actions? Ans: JSP actions are executed when a JSP page is requested. Actions are inserted in the jsp page using XML syntax to control the behavior of the servlet engine. Using action, we can dynamically insert a file, reuse bean components, forward the user to another page, or generate HTML for the Java plugin. Some of the available actions are as follows: <jsp: include> include a file at the time the page is requested. <jsp: useBean> find or instantiate a JavaBean. <jsp: setProperty> set the property of a JavaBean. <jsp: getProperty> insert the property of a JavaBean into the output. <jsp: forward> forward the requester to a new page. <jsp: plugin> generate browser-specific code that makes an OBJECT or EMBED tag for the Java plugin.

Q.what are Script lets? Ans: Script lets are blocks of programming language code (usually java) embedded within a JSP page. Scriptlet code is inserted into the servlet generated from the page. Scriptlet code is defined between <% and %> Q.what are Decalarations? Ans: Declarations are similar to variable declarations in Java. Variables are defined for subsequent use in expressions or script lets. Q.How to declare instance or global variables in jsp? Ans: Instance variables should be declared inside the declaration part. The variables declared with JSP declaration element will be shared by all requests to the jsp page. Q.what are Expressions? Ans: Expressions are variables or constants that are inserted into the data returned by the web server. Q.what is meant by implicit objects? And what are they? Ans: Implicit objects are those objects which are available by default. These objects are instances of classes defined by the JSP specification. These objects could be used within the jsp page without being declared. The following are the implicit jsp objects: 1. application 2. Page 3. Request 4. Response 5. Session 6. Exception 7. Out 8. Config 9. Page Context

You might also like