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, 1749👍, 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, 1741👍, 0💬
Can we implement an interface in a JSP?
Can we implement an interface in a JSP? No 2013-08-10, 1733👍, 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, 1725👍, 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. Do note that you should always supply a relative URL for the file attribute. Although you can also... 2013-07-17, 1718👍, 0💬
In the Servlet 2.4 specification SingleThreadModel has been deprecated, why?
In the Servlet 2.4 specification SingleThreadModel has been deprecated, why? Because it is not practical to have such model. Whether you set isThreadSafe to true or false, you should take care of concurrent client requests to the JSP page by synchronizing access to any shared objects defined at the ... 2013-07-16, 1706👍, 0💬
How do I mix JSP and SSI #include? What is the difference between include directive & jsp:include action?
How do I mix JSP and SSI #include? What is the difference between include directive & jsp:include action? Difference between include directive and 1. provides the benifits of automatic recompliation,smaller class size ,since the code corresponding to the included page is not present in the servl... 2013-08-06, 1695👍, 0💬
Can we use the constructor, instead of init(), to initialize servlet?
Can we use the constructor, instead of init(), to initialize servlet? Yes , of course you can use the constructor instead of init(). There’s nothing to stop you. But you shouldn’t. The original reason for init() was that ancient versions of Java couldn’t dynamically invoke constructors with argumen... 2013-07-10, 1682👍, 0💬
What are stored procedures? How is it useful?
What are stored procedures? How is it useful? A stored procedure is a set of statements/commands which reside in the database. The stored procedure is pre-compiled and saves the database the effort of parsing and compiling sql statements everytime a query is run. Each database has its own stored pro... 2013-07-17, 1672👍, 0💬
Can you make use of a ServletOutputStream object from within a JSP page?
Can you make use of a ServletOutputStream object from within a JSP page? No. You are supposed to make use of only a JSPWriter object (given to you in the form of the implicit object out) for replying to clients. A JSPWriter can be viewed as a buffered version of the stream object returned by respons... 2013-08-02, 1663👍, 0💬
The code in a finally clause will never fail to execute, right?
The code in a finally clause will never fail to execute, right? Using System.exit(1); in try block will not allow finally code to execute. 2013-07-11, 1660👍, 0💬
What are the implicit objects?
What are the implicit objects? Implicit objects are objects that are created by the web container and contain information related to a particular request, page, or application. They are: --request --response --pageContext --session --application --out --config --page --exception 2013-07-08, 1655👍, 0💬
Is there a way I can set the inactivity lease period on a per-session basis?
Is there a way I can set the inactivity lease period on a per-session basis? Typically, a default inactivity lease period for all sessions is set within your JSPengine admin screen or associated properties file. However, if your JSP engine supports the Servlet 2.1 API, you can manage the inactivity ... 2013-07-31, 1654👍, 0💬
What is a JSP and what is it used for?
What is a JSP and what is it used for? Java Server Pages (JSP) is a platform independent presentation layer technology that comes with SUN s J2EE platform. JSPs are normal HTML pages with Java code pieces embedded in them. JSP pages are saved to *.jsp files. A JSP compiler is used in the background ... 2013-07-04, 1643👍, 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 necess... 2013-08-06, 1640👍, 0💬
What is JSP page?
What is JSP page? A JSP page is a text-based document that contains two types of text: static template data, which can be expressed in any text-based format such as HTML, SVG, WML, and XML, and JSP elements, which construct dynamic content. 2013-07-08, 1631👍, 0💬
What JSP lifecycle methods can I override?
What JSP lifecycle methods can I override? You cannot override the _jspService() method within a JSP page. You can however, override the jspInit() and jspDestroy() methods within a JSP page. jspInit() can be useful for allocating resources like database connections, network connections, and so forth... 2013-07-24, 1625👍, 0💬
How can I implement a thread-safe JSP page?
How can I implement a thread-safe JSP page? You can make your JSPs thread-safe by having them implement the SingleThreadModel interface. This is done by adding the directive <%@ page isThreadSafe="false" % > within your JSP page. 2013-07-27, 1616👍, 0💬
What are the two kinds of comments in JSP and what's the difference between them.
What are the two kinds of comments in JSP and what's the difference between them. <%-- JSP Comment --%> <!-- HTML Comment --> 2013-07-05, 1596👍, 0💬
What is JSP technology?
What is JSP technology? Java Server Page is a standard Java extension that is defined on top of the servlet Extensions. The goal of JSP is the simplified creation and management of dynamic Web pages. JSPs are secure, platform-independent, and best of all, make use of Java as a server-side scripting ... 2013-07-05, 1594👍, 0💬
What is difference between custom JSP tags and beans?
What is difference between custom JSP tags and beans? Custom JSP tag is a tag you defined. You define how a tag, its attributes and its body are interpreted, and then group your tags into collections called tag libraries that can be used in any number of JSP files. To use custom JSP tags, you need t... 2013-07-04, 1590👍, 0💬
What Class.forName will do while loading drivers?
What Class.forName will do while loading drivers? It is used to create an instance of a driver and register it with the DriverManager. When you have loaded a driver, it is available for making a connection with a DBMS. 2013-07-15, 1588👍, 0💬
Can a JSP page instantiate a serialized bean?
Can a JSP page instantiate a serialized bean? No problem! The useBean action specifies the beanName attribute, which can be used for indicating a serialized bean. For example: A couple of important points to note. Although you would have to name your serialized file "filename.ser", you only indicate... 2013-08-02, 1587👍, 0💬
How could Java classes direct program messages to the system console, but error messages, say to a f...
Why is it preferred to not use finalize for clean up? Problem with finalize is that garbage collecti...
What is normalization? What are different types of normalization? It is set of rules that have been ...
What is Windows DNA architecture? Note :- If you have worked with classic ASP this question can come...
Can you explain why your project needed XML? Remember XML was meant to exchange data between two ent...