Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

i have a question

 
Niki Sharma
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
was looking through some jwcd questionaire's and found a very weird question.. which i am unable to fathom..
Which of the following staments are correct about the following jsp lines:
Given the following jsp line select the correct statements:
<% public void jspInit() { ...java code...} %>
the answer says
1) It is a valid line that can be used to initialize the servlet that implements the jsp file.
Now I am curious.. I assume since it is a scriptlet it goes into the service method right.. and how can jspInit show up inside a service method..
could someone clarify how this function.... could be right
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think this is just a typo.
Instead of

It should be:

Nick
 
Niki Sharma
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nic
thanks for the response

>>2.
<taglib>
<taglib-uri>/binomial</taglib-uri>
<taglib-location>/WEB-INF/MathLib.jar</taglib-location>
</taglib>
there was another questionairre i was going through that said this was invalid.. I presume is it correct
I was of the assumption that one could reference a jar file as you tag-lib location.. and it would be valid.. Do you have any inputs on this..
thanks ..
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is a valid taglib definition, if and only if, the xxx.tld is located at the /META-INF inside the JAR file.
If the .tld file does not locate in that directory, the taglib cannot be found.
Nick
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!