1 2 3 4 5 > >>   Sort: Rank

Passing Control from One JSP Page to Another
How do you pass control from one JSP page to another? Use the following ways to pass control of a request from one servlet to another or one jsp to another. The RequestDispatcher object's forward method to pass the control. The response.sendRedirect method
2024-02-05, 6011👍, 2💬

💬 2023-12-20 Bhara: Nice

Is JSP technology extensible?
Is JSP technology extensible? YES. JSP technology is extensible through the development of custom actions, or tags, which are encapsulated in tag libraries.
2019-01-07, 4520👍, 1💬

💬 2019-01-07 Hgf: Very good

How many JSP scripting elements and what are they?
How many JSP scripting elements and what are they? There are three scripting language elements: --declarations --scriptlets --expressions
2016-06-25, 4073👍, 1💬

💬 2016-06-25 saidesh: Jsp scripting elements are three types: Declaration, Expression, Scriptlet.

How do I generate a list of all .html files in a directory?
How do I generate a list of all .html files in a directory? Here's a snippet of code that just prints a listing of every file in the current directory that ends with the extension .html: #!/usr/bin/perl -w opendir(DIR, "."); @files = grep(/\.html$/,readdir(DIR)); closedir(DIR); foreach $file (@files...
2013-08-23, 2299👍, 0💬

How do I do fill_in_the_blank for each file in a directory?
How do I do fill_in_the_blank for each file in a directory? Here's code that just prints a listing of every file in the current directory: #!/usr/bin/perl -w opendir(DIR, "."); @files = readdir(DIR); closedir(DIR); foreach $file (@files) { print "$file\n"; }
2013-08-23, 2339👍, 0💬

How can my application get to know when a HttpSession is removed?
How can my application get to know when a HttpSession is removed? Define a Class HttpSessionNotifier which implements HttpSessionBindingListener and implement the functionality what you need in valueUnbound() method. Create an instance of that class and put that instance in HttpSession.
2013-08-20, 2417👍, 0💬

How does JSP handle runtime exceptions?
How does JSP handle runtime exceptions? Using errorPage attribute of page directive and also we need to specify isErrorPage=true if the current page is intended to URL redirecting of a JSP.
2013-08-20, 2343👍, 0💬

What is the difference between RequestDispatcher and sendRedirect?
What is the difference between RequestDispatcher and sendRedirect? RequestDispatcher: server-side redirect with request and response objects. sendRedirect : Client-side redirect with new request and response objects.
2013-08-19, 2749👍, 0💬

What is the difference between directive include and jsp include?
What is the difference between directive include and jsp include? <%@ include> : Used to include static resources during translation time. : Used to include dynamic content or static content during runtime.
2013-08-19, 2401👍, 0💬

Can you override jspInit() method? If yes, In which cases?
Can you override jspInit() method? If yes, In which cases? ye, we can. We do it usually when we need to intialize any members which are to be available for a servlet/JSP throughout its lifetime.
2013-08-16, 2580👍, 0💬

A JSP page, include.jsp, has a instance variable "int a", now this page is statically included in another JSP page, index.jsp, w
A JSP page, include.jsp, has a instance variable "int a", now this page is statically included in another JSP page, index.jsp, which has a instance variable "int a" declared. What happens when the index.jsp page is requested by the client? Compilation error, as two variables with same name can't be ...
2013-08-16, 2533👍, 0💬

What happens when a page is statically included in another JSP page?
What happens when a page is statically included in another JSP page? An include directive tells the JSP engine to include the contents of another file (HTML, JSP, etc.) in the current page. This process of including a file is also called as static include.
2013-08-15, 2260👍, 0💬

Explain the life cycle of JSP?
Explain the life cycle of JSP? Any JSP page goes through 7 phases in its entire lifecycle Phase Name Description Page translation The page is parsed and a Java file containing the corresponding servlet is created. Page compilation The Java file is compiled. Load class The compiled class is loaded. C...
2013-08-15, 2377👍, 0💬

Why is _jspService() method starting with an '_' while other life cycle methods do not?
Why is _jspService() method starting with an '_' while other life cycle methods do not? _jspService() method will be written by the container hence any methods which are not to be overridden by the end user are typically written starting with an '_'. This is the reason why we don't override _jspServ...
2013-08-14, 2575👍, 0💬

Can we override the jspInit(), _jspService() and jspDestroy() methods?
Can we override the jspInit(), _jspService() and jspDestroy() methods? We can override jspinit() and jspDestroy() methods but not _jspService().
2013-08-14, 2409👍, 0💬

How is JSP include directive different from JSP include action.
How is JSP include directive different from JSP include action. When a JSP include directive is used, the included file's code is added into the added JSP page at page translation time, this happens before the JSP page is translated into a servlet. While if any page is included using action tag, the...
2013-08-13, 2199👍, 0💬

How to pass information from JSP to included JSP?
How to pass information from JSP to included JSP? Using <%jsp:param> tag.
2013-08-13, 2068👍, 0💬

What is the difference in using request.getRequestDispatcher() and context.getRequestDispatcher()?
What is the difference in using request.getRequestDispatcher() and context.getRequestDispatcher() ?request.getRequestDispatcher(p ath):In order to create it we need to give the relative path of the resource context.getRequestDispatcher(p ath):In order to create it we need to give the absolute path o...
2013-08-12, 2134👍, 0💬

What is the difference between ServletContext and PageContext?
What is the difference between ServletContext and PageContext? ServletContext: Gives the information about the container PageContext: Gives the information about the Request
2013-08-12, 2506👍, 0💬

Can we implement an interface in a JSP?
Can we implement an interface in a JSP? No
2013-08-10, 2142👍, 0💬

How do you delete a Cookie within a JSP?
How do you delete a Cookie within a JSP? Cookie mycook = new Cookie("name","value"); response.addCookie(mycook); Cookie killmycook = new Cookie("mycook","value"); killmycook.setMaxAge(0); killmycook.setPath("/"); killmycook.addCookie(killmycoo k);
2013-08-10, 2181👍, 0💬

What is the page directive is used to prevent a JSP page from automatically creating a session?
What is the page directive is used to prevent a JSP page from automatically creating a session? <%@ page session="false">
2013-08-08, 2348👍, 0💬

How do you connect to the database from JSP?
How do you connect to the database from JSP? A Connection to a database can be established from a jsp page by writing the code to establish a connection using a jsp scriptlets. Further then you can use the resultset object "res" to read data in the following way.
2013-08-08, 2203👍, 0💬

How can I set a cookie and delete a cookie from within a JSP page?
How can I set a cookie and delete a cookie from within a JSP page? A cookie, mycookie, can be deleted using the following scriptlet:
2013-08-07, 2216👍, 0💬

1 2 3 4 5 > >>   Sort: Rank