File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes a qstn Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "a qstn" Watch "a qstn" New topic
Author

a qstn

tony lee
Ranch Hand

Joined: Jan 21, 2002
Posts: 52
Given:
<jsp:useBean id="temp"
class="java.lang.String" />
<% temp="temp";
out.println(temp); %>
What is the output?
A) temp
B) empty
C) ServletException
D) null
A is correct choice.
I think var temp in <% temp="temp";
out.println(temp); %> is not defined. How does it work


SCJP2, SCWCD
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
"temp" is defined by the useBean tag...
- Peter
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
tricky question.
As we all know the jsp generates a servlet from the .jsp-file. These servlets (source + class files) are stored in a special directory (in Tomcat its called <root>/work). Sometimes it helps to examine these files. This is such a case, I think. Then you see, why it is as it is.
 
 
subject: a qstn
 
Threads others viewed
Java string object value to javascript
question
why prints blank page
useBean
what exactly is happening?
IntelliJ Java IDE