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

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, 1630👍, 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, 1689👍, 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, 1798👍, 0💬

What is JSP?
What is JSP? Let's consider the answer to that from two different perspectives: that of an HTML designer and that of a Java programmer. If you are an HTML designer, you can look at JSP technology as extending HTML to provide you with the ability to seamlessly embed snippets of Java code within your ...
2013-08-05, 1521👍, 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, 1577👍, 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, 1655👍, 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, 1720👍, 0💬

How does a servlet communicate with a JSP page?
How does a servlet communicate with a JSP page? The following code snippet shows how a servlet instantiates a bean and initializes it with FORM data posted by a browser. The bean is then placed into the request, and the call is then forwarded to the JSP page, Bean1.jsp, by means of a request dispatc...
2013-08-01, 1530👍, 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, 1644👍, 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, 1794👍, 0💬

Is there a way to reference the "this" variable within a JSP page?
Is there a way to reference the "this" variable within a JSP page? Yes, there is. Under JSP 1.0, the page implicit object is equivalent to "this", and returns a reference to the servlet generated by the JSP page.
2013-07-30, 1543👍, 0💬

Can a JSP page process HTML FORM data?
Can a JSP page process HTML FORM data? Yes. However, unlike servlets, you are not required to implement HTTP-protocol specific methods like doGet() or doPost() within your JSP page. You can obtain the data for the FORM input elements via the request implicit object within a scriptlet or expression a...
2013-07-30, 1565👍, 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, 1823👍, 0💬

How can I declare methods within my JSP page?
How can I declare methods within my JSP page? You can declare methods for use within your JSP page as declarations. The methods can then be invoked within any other methods you declare, or within JSP scriptlets and expressions. Do note that you do not have direct access to any of the JSP implicit ob...
2013-07-29, 1515👍, 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 &lt;%@ page isThreadSafe="false" % &gt; within your JSP page.
2013-07-27, 1611👍, 0💬

Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside
Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB? You can pass the HttpSession as parameter to an EJB method, only if all objects in session are serializable. This has to be consider as "passed-by-value", that mean...
2013-07-27, 1528👍, 0💬

How do I use comments within a JSP page?
How do I use comments within a JSP page? You can use "JSP-style" comments to selectively block out code while debugging or simply to comment your scriptlets. JSP comments are not visible at the client. For example: --%&gt; You can also use HTML-style comments anywhere within your JSP page. These...
2013-07-25, 1547👍, 0💬

How does JSP handle run-time exceptions?
How does JSP handle run-time exceptions? You can use the errorPage attribute of the page directive to have uncaught runtime exceptions automatically forwarded to an error processing page. For example: redirects the browser to the JSP page error.jsp if an uncaught exception is encountered during requ...
2013-07-25, 1543👍, 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, 2081👍, 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, 1615👍, 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, 1993👍, 0💬

How do I prevent the output of my JSP or Servlet pages from being cached by the browser?
How do I prevent the output of my JSP or Servlet pages from being cached by the browser? You will need to set the appropriate HTTP header attributes to prevent the dynamic content output by the JSP page from being cached by the browser. Just execute the following scriptlet at the beginning of your J...
2013-07-23, 1529👍, 0💬

How can I enable session tracking for JSP pages if the browser has disabled cookies?
How can I enable session tracking for JSP pages if the browser has disabled cookies? We know that session tracking uses cookies by default to associate a session identifier with a unique user. If the browser does not support cookies, or if cookies are disabled, you can still enable session tracking ...
2013-07-20, 1558👍, 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, 1773👍, 0💬

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