1 2 3 4 5 > >>   Sort: Rank

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, 1936👍, 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, 1477👍, 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, 1471👍, 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, 1594👍, 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, 1558👍, 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, 1763👍, 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, 1542👍, 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, 1574👍, 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, 1604👍, 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, 1550👍, 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, 1571👍, 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, 1420👍, 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, 1388👍, 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, 1353👍, 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, 1333👍, 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, 1356👍, 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, 1374👍, 0💬

Can we implement an interface in a JSP?
Can we implement an interface in a JSP? No
2013-08-10, 1341👍, 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, 1346👍, 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, 1535👍, 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, 1370👍, 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, 1424👍, 0💬

How do I use a scriptlet to initialize a newly instantiated bean?
How do I use a scriptlet to initialize a newly instantiated bean? A jsp:useBean action may optionally have a body. If the body is specified, its contents will be automatically invoked when the specified bean is instantiated. Typically, the body will contain scriptlets or jsp:setProperty tags to init...
2013-08-07, 1340👍, 0💬

How do you prevent the Creation of a Session in a JSP Page and why? What is the difference between include directive & jsp:inclu
How do you prevent the Creation of a Session in a JSP Page and why? What is the difference between include directive & jsp:include action? By default, a JSP page will automatically create a session for the request if one does not exist. However, sessions consume resources and if it is not necessary ...
2013-08-06, 1337👍, 0💬

1 2 3 4 5 > >>   Sort: Rank