<< < 28 29 30 31 32 33 34 35 36 37 38 > >>   Sort: Rank

What happens when you return a reference to a private variable?
What happens when you return a reference to a private variable? Perl keeps track of your variables, whether dynamic or otherwise, and doesn't free things before you're done using them.
2013-08-27, 1777👍, 0💬

Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}?
Assuming both a local($var) and a my($var) exist, what's the difference between ${var} and ${"var"}? ${var} is the lexical variable $var, and ${"var"} is the dynamic variable $var. Note that because the second is a symbol table lookup, it is disallowed under `use strict "refs"'. The words global, lo...
2013-08-26, 1876👍, 0💬

What is Perl one-liner?
What is Perl one-liner? There are two ways a Perl script can be run: --from a command line, called one-liner, that means you type and execute immediately on the command line. You'll need the -e option to start like "C:\ %gt perl -e "print "Hello";". One-liner doesn't mean one Perl statement. One-lin...
2013-08-26, 1931👍, 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, 2323👍, 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, 2366👍, 0💬

How to open and read data files with Perl
How to open and read data files with Perl Data files are opened in Perl using the open() function. When you open a data file, all you have to do is specify (a) a file handle and (b) the name of the file you want to read from. As an example, suppose you need to read some data from a file named "check...
2013-08-22, 1823👍, 0💬

Which of these is a difference between C++ and Perl?
Which of these is a difference between C++ and Perl? Perl can have objects whose data cannot be accessed outside its class, but C++ cannot. Perl can use closures with unreachable private data as objects, and C++ doesn't support closures. Furthermore, C++ does support pointer arithmetic via `int *ip ...
2013-08-22, 1965👍, 0💬

How do I set environment variables in Perl programs?
How do I set environment variables in Perl programs? you can just do something like this: $ENV{'PATH'} = '...'; As you may remember, "%ENV" is a special hash in Perl that contains the value of all your environment variables. Because %ENV is a hash, you can set environment variables just as you'd set...
2013-08-21, 1887👍, 0💬

Why do you use Perl?
Why do you use Perl? Perl is a powerful free interpreter. Perl is portable, flexible and easy to learn.
2013-08-21, 1934👍, 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, 2443👍, 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, 2366👍, 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, 2765👍, 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, 2417👍, 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, 2595👍, 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, 2578👍, 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, 2280👍, 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, 2401👍, 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, 2604👍, 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, 2443👍, 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, 2219👍, 0💬

How to pass information from JSP to included JSP?
How to pass information from JSP to included JSP? Using &lt;%jsp:param&gt; tag.
2013-08-13, 2082👍, 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, 2157👍, 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, 2518👍, 0💬

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

<< < 28 29 30 31 32 33 34 35 36 37 38 > >>   Sort: Rank