-
C: namesList = context.listContents(someContextName);
Binding binding = namesList.next();
MyObject obj = binding.getObject();
D: namesList = context.list(someContextName);
Binding binding = namesList.next();
MyObject obj = (MyObject) binding.getObject("MyObject");
">To create a DSI (Dynamic Skeleton Interface) based server, the server must extendA: org.omg.CORBA.DynamicImplementation B: org.omg.CORBA.DynamicSkeleton C: org.omg.CORBA.SkeletonInterface D: org.omg.CORBA.DSIHow would you get the actual bound object of type MyObject using JNDI?A: namesList = context.listBindings(someContextName); Binding binding = namesList.next(); MyObject obj = (MyObject) binding.getObject(); B: namesList = context.listBindings(someContextName); Binding binding = namesList.next(); MyObject obj = binding.getObject("MyObject"); C: namesList = context.listContents(someContextName); Binding binding = namesList.next(); MyObject obj = binding.getObject(); D: namesList = context.list(someContextName); Binding binding = namesList.next(); MyObject obj = (MyObject) binding.getObject("MyObject");
-
-
-
-
Can I invoke a JSP error page from a servlet?
Yes, you can invoke the JSP error page and pass the exception object to it from within a servlet. The trick is to create a request dispatcher for the JSP error page, and pass the exception object as a javax.servlet.jsp.jspException request attribute. However, note that you can do this from only within controller servlets.If your servlet opens an OutputStream or PrintWriter, the JSP engine will throw...
-
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:<%@ page errorPage="error.jsp" %>redirects the browser to the JSP page error.jsp if an uncaught exception is encountered during request processing. Within error.jsp, if you indicate that it is an error-processing page, via the directive:<%@...
-
What is the difference between ServletContext and ServletConfig?
Both are interfaces. The servlet engine implements the ServletConfig interface in order to pass configuration information to a servlet. The server passes an object that implements the ServletConfig interface to the servlet's init() method.The ServletContext interface provides information to servlets regarding the environment in which they are running. It also provides standard way for servlets to write...
-
-
How to implement pagination from database level.
Please provide me any sample source code for the same
-
-
-
These ____________ listeners are notified when the Servlet context (i.e., the Web application) is initialized and destroyed/
Skill/Topic: JSP Thread ModelA) Session AttributeB) Servlet context attributeC) Session ListenersD) Servlet context listeners
-
The response.sendRedirect("……..”); is the response implicit object to redirect the browser to the different resource
Skill/Topic: Programming ConstructsA) TrueB) False
-
-
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:<%-- the scriptlet is now commented out<%out.println("Hello World");%>--%>You can also use HTML-style comments anywhere within your JSP page. These comments are visible at the client. For example:<!-- (c) 2004 javagalaxy.com...
-
State true or false -- While using request.getRequestDispatcher(path) we need to give the absolute path of the object
Skill/Topic: Programming ConstructsA) TrueB) FalseExplanation: request.getRequestDispatcher(path): In order to create it we need to give the relative path of the resource, context.getRequestDispatcher(path): In order to create it we need to give the absolute path of the resource.
-
When u try to redirect a page after you already have written something in your page, the error encountered is “Response has already been committed error” or popularly called 402 error.
Skill/Topic: Programming ConstructsA) FalseB) True
-
The error message displayed when the page is not found at the correct location.
Skill/Topic: Programming ConstructsA) 550 B) 440 C) 505 D) 404
-
State true or false - We make use of a ServletOutputStream object from the JSP page
Skill/Topic: Programming ConstructsA) TrueB) FalseExplanation: use the JSPWriter object
-
We can restrict the calling of the errorPage in the JSP by setting the value true for the ______ param in the ErrorPage attribute of the Page Directory
Skill/Topic: Programming ConstructsA) isErrorpage
JSP Interview Questions
Ans