• Post Reply Bookmark Topic Watch Topic
  • New Topic

Some qtns on jsp  RSS feed

 
jyothi godavarthy
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, can anyone answer these :
-------------------
True or False? Scriplets / Expressions / Declarations
cannot be written between <useBean.....></useBean>
tags
True.
False.
---------
Which of the following would you use as a way to
connect to database from jsp?
Write the data access code directly in scriptlet. As
it is fast, clear and upfront.
Write a Jsp super class which handles data access and
extend the jsp page from it.
Write a JavaBean which handles the data access and
use the bean in jsp.
Write a tag-lib for data access.
Use the in-built jsp data-base tags
--------
Question : <jsp:useBean .......... scope='session' >
<%="hello "%>
</useBean>
<%="world"%>
What will be the output on the browser when the above
jsp is called?

Compile error. Cannot Write Expression inside
useBean.
Parser Error. Cannot Write Expression inside useBean.
Output of hello word.
Output of "hello word" for the first time and only
"world" for any subsequent requests.
Output of "hello word" for the first time and only
"world" for subsequent requests for same session.
 
jyothi godavarthy
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of my friends has asked these qtns and I think the answers are :
1. False
2. Write a JavaBean which handles the data access and
use the bean in jsp.
3.Output of "hello word" for the first time and only
"world" for subsequent requests for same session.
Are these answers correct.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!