Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic