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

Mock Exam Doubts

 
sravanthi pulukuri
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

There was a Question about the location of TLD.
options are
A./WEB-INF
B./META-INF
C./WEB-INF/tlds
D./META-INF/tlds
E./WEB-INF/resources
F./META-INF/resources.

Answer was given as A,C,E. i dont know how it was E??Please help

2.
Which two listners are needed to declared in DD?
1. HttpSessionBindingListner
2. HttpSessionTimedoutListner
3.HttpSessionAttributeListner
4.HttpSessionActivationListner
5.HttpSessionPassivatedListner
6.HttpSessionListner


I think answer should be 1 and 4.but was given as 1,3,5

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
About 1: JSP.7.3.1 Identifying Tag Library Descriptors

When deployed directly into a web application, the tag library descriptor files must always be in the WEB-INF directory, or some subdirectory of it. TLD files should not be placed in /WEB-INF/classes or /WEB-INF/lib.

About 2 : check this FAQ.
 
Sonali Sabnis
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By looking at this : http://faq.javaranch.com/java/DeclaringListeners

we don't need to declare both HttpSessionBindingListener and HttpSessionActivationListener in DD.

So the answer should be HttpSessionAttributeListner and HttpSessionListner.
correct me if I am wrong.
 
Poonam Agarwal
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sonali sabnis wrote:By looking at this : http://faq.javaranch.com/java/DeclaringListeners

we don't need to declare both HttpSessionBindingListener and HttpSessionActivationListener in DD.

So the answer should be HttpSessionAttributeListner and HttpSessionListner.
correct me if I am wrong.



HttpSessionBindingListener and HttpSessionActivationListener dose not require any declration in web.xml file.
rest are need to be declared through <listener> tag.

 
Poonam Agarwal
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sravanthi pulukuri wrote:Hi,

There was a Question about the location of TLD.
options are
A./WEB-INF
B./META-INF
C./WEB-INF/tlds
D./META-INF/tlds
E./WEB-INF/resources
F./META-INF/resources.

Answer was given as A,C,E. i dont know how it was E??Please help

2.
Which two listners are needed to declared in DD?
1. HttpSessionBindingListner
2. HttpSessionTimedoutListner
3.HttpSessionAttributeListner
4.HttpSessionActivationListner
5.HttpSessionPassivatedListner
6.HttpSessionListner


I think answer should be 1 and 4.but was given as 1,3,5



please mention your source!!
 
Dhruva Mistry
Ranch Hand
Posts: 67
Eclipse IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sravanthi pulukuri wrote:Hi,

There was a Question about the location of TLD.
options are
A./WEB-INF
B./META-INF
C./WEB-INF/tlds
D./META-INF/tlds
E./WEB-INF/resources
F./META-INF/resources.

Answer was given as A,C,E. i dont know how it was E??Please help

2.
Which two listners are needed to declared in DD?
1. HttpSessionBindingListner
2. HttpSessionTimedoutListner
3.HttpSessionAttributeListner
4.HttpSessionActivationListner
5.HttpSessionPassivatedListner
6.HttpSessionListner


I think answer should be 1 and 4.but was given as 1,3,5




for your 1st Query: for E option, in practical world, "resources" will be referred as "name of a folder" where you will put your tld files eg in my project, there ia a folder named "jstl" where other few tld are residing
in short, in \WEB-INF tld get stored

sorry for your 2nd Query for i am just new to web developments

hoping explanation for 1st Q of your will help you out
 
Abhijit Das
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
generally resources folder are used for jsp, html .... which are placed outside the /WEB-INF. According the convention, the question should not be like this.

Otherwise, tld must be placed inside /WEB-INF.

I am not sure whether it can be placed inside

/WEB-INF/lib or /WEB-INf/classes.

am i correct?
 
Dhruva Mistry
Ranch Hand
Posts: 67
Eclipse IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhijit Das wrote:hi,
generally resources folder are used for jsp, html .... which are placed outside the /WEB-INF. According the convention, the question should not be like this.

Otherwise, tld must be placed inside /WEB-INF.

I am not sure whether it can be placed inside

/WEB-INF/lib or /WEB-INf/classes.

am i correct?


in \WEB-INF\lib ----resides --> .jar files
in \WEB-INF\class ----resides---> .class files
 
sridhar row
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sravanthi pulukuri wrote:Hi,

There was a Question about the location of TLD.
options are
A./WEB-INF
B./META-INF
C./WEB-INF/tlds
D./META-INF/tlds
E./WEB-INF/resources
F./META-INF/resources.

Answer was given as A,C,E. i dont know how it was E??Please help



D is also correct. TLDs can be in META-INF or a subdirectory of META-INF if deployed in a JAR.
 
Gupta Singh
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sridhar row wrote:
D is also correct. TLDs can be in META-INF or a subdirectory of META-INF if deployed in a JAR.


Not in this case. Option D refers to the top-level META-INF, the sibling to WEB-INF as noted by the '/'. The META-INF you are refering to is the lower-level META-INF directory found inside .jar files.

 
sridhar row
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gupta Singh wrote:
sridhar row wrote:
D is also correct. TLDs can be in META-INF or a subdirectory of META-INF if deployed in a JAR.


Not in this case. Option D refers to the top-level META-INF, the sibling to WEB-INF as noted by the '/'. The META-INF you are refering to is the lower-level META-INF directory found inside .jar files.



You are right..thanks for the correction.
 
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!