<< < 1 2 3 4 5 > >>   Sort: Date

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, 2117👍, 0💬

How do I perform browser redirection from a JSP page?
How do I perform browser redirection from a JSP page? You can use the response implicit object to redirect the browser to a different resource, as: response.sendRedirect("http:// www.exforsys.com/path/error.ht ml");You can also physically alter the Location HTTP header attribute, as shown below: You ...
2013-07-24, 2090👍, 0💬

How do you restrict page errors display in the JSP page?
How do you restrict page errors display in the JSP page? You first set "Errorpage" attribute of PAGE directory to the name of the error page (ie Errorpage="error.jsp")in your jsp page .Then in the error jsp page set "isErrorpage=TRUE". When an error occur in your jsp page it will automatically call ...
2013-07-23, 2028👍, 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, 2026👍, 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, 1980👍, 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, 1951👍, 0💬

What is the difference between directive include and jsp include?
What is the difference between directive include and jsp include? &lt;%@ include&gt; : Used to include static resources during translation time. : Used to include dynamic content or static content during runtime.
2013-08-19, 1941👍, 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, 1907👍, 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, 1902👍, 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? &lt;%@ page session="false"&gt;
2013-08-08, 1887👍, 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, 1866👍, 0💬

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, 1861👍, 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, 1847👍, 0💬

How many JSP scripting elements are there and what are they?
How many JSP scripting elements are there and what are they? There are three scripting language elements: declarations, scriptlets, expressions.
2013-07-16, 1840👍, 0💬

Can I stop JSP execution while in the midst of processing a request?
Can I stop JSP execution while in the midst of processing a request? Yes. Preemptive termination of request processing on an error condition is a good way to maximize the throughput of a high-volume JSP engine. The trick (asuming Java is your scripting language) is to use the return statement when y...
2013-07-29, 1831👍, 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, 1817👍, 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, 1811👍, 0💬

How do you pass 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
2013-07-31, 1808👍, 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, 1806👍, 0💬

How do I mix JSP and SSI #include?
How do I mix JSP and SSI #include? Answer 1 If you're just including raw HTML, use the #include directive as usual inside your .jsp file. But it's a little trickier if you want the server to evaluate any JSP code that's inside the included file. If your data.inc file contains jsp code you will have ...
2013-08-05, 1806👍, 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, 1803👍, 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, 1783👍, 0💬

Why does JComponent have add() and remove() methods but Component does not?
Why does JComponent have add() and remove() methods but Component does not? because JComponent is a subclass of Container, and can contain other components and jcomponents. How can I implement a thread-safe JSP page? - You can make your JSPs thread-safe by having them implement the SingleThreadModel...
2013-07-20, 1782👍, 0💬

How do I include static files within a JSP page?
How do I include static files within a JSP page? Static resources should always be included using the JSP include directive. This way, the inclusion is performed just once during the translation phase. The following example shows the syntax: &lt; % @ include file="copyright.html" % &gt; Do n...
2013-08-01, 1759👍, 0💬

<< < 1 2 3 4 5 > >>   Sort: Date