• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubts from Marcus Green Mock Exam

 
Ranch Hand
Posts: 171
Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all I want to thank Marcus Green for providing us wonderful mock exam and study material.

Doubts from Marcus Green Mock Exams

Summary quiz 1

Question 6
We have two <security-constraint> elements.Both with same <url-pattern> and <http-method>.
One of <security-constraint> has <auth-constarint/> and other has <auth-constarint>*</auth-constraint>
Then it means no one can access the resources mapped to <url-pattern> using <http-method> mentioned.
i.e. Empty <auth-constraint/> does have its effect.

In the mock's answer: Any user will be able to access the resource

Question 22
Statement :tld files can be stored anywhere withint the application path.
I think its true.
There are places where container looks for tlds (/WEB-INF and its subdirectory ,META-INF and its subdirectory in jar) through implicit mapping.
But again,we can have our own mapping in DD(using <taglib-uri> element) or just let the uri decide the real location of tld file.

But in answer this option is not chosen as true.

Question 47
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>com.examulator.HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloWorld</servlet-name>
<url-pattern>*.java</url-pattern>
</servlet-mapping>

Is this url-pattern is valid.I see no problem in it.Althogh explanation there justify it.But its not in the correct answers.

Question 58
A JSP document (i.e. in XML syntax) must start with the root tag

Is it true?I think i read somewhere that root tag is not mandatory in jsp document.
I could not find the answer in spec.

Answer in mock is: true


Summary Quiz 2

Question 55
Given a jsp page called index.jsp with the content


And a menu.jsp file available to index.jsp containing



What will happen when you attempt to compile and run index.jsp?

Choose one answer. A. Compilation and output of morning good morning
B. Compilation and output of good morning
C. Compilation and output of good null
D. Compilation but runtime error

Answer given is D

But I got following output:

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 3 in the jsp file: /menu.jsp
Generated servlet error:
greeting cannot be resolved



Summary quiz 3

Ques 17
Which servlet methods are used by servlets to process the data in form fields?

In answers doGet() is not chosen among options.

Ques 62
Following statement is chosen as true:
The taglib directive can use either the tagdir or the uri attribute to locate the tld file.

But tagdir attribute is not for locating tld file.It is for finding tag file.

Ques 65
Following statement is chosen as true:
Using classes that implement DynamicAttributes requires that they be declared in the deployment descriptor


Tag class is declared in tld ( in <tag>'s <tag-class> element)even if it does not implement DynamicAttributes interface. So this statement
does not appear accurate.
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bindu Lakhanpal wrote:Question 6
We have two <security-constraint> elements.Both with same <url-pattern> and <http-method>.
One of <security-constraint> ....

In the mock's answer: Any user will be able to access the resource



Agreed, I think its an error in the mock exam.

Bindu Lakhanpal wrote:Question 22
Statement :tld files can be stored anywhere within the application path.
.......
But in answer this option is not chosen as true.


I'm not sure what is meant by application path here so can't say

Bindu Lakhanpal wrote:Question 47
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>com.examulator.HelloWorld</servlet-class>
.......

Is this url-pattern is valid.I see no problem in it.Althogh explanation there justify it.But its not in the correct answers.



Again I feel that this is an error in the mock exam

Bindu Lakhanpal wrote:Question 58
A JSP document (i.e. in XML syntax) must start with the root tag

Answer in mock is: true


An XML file can contain only one root element, even the directives go inside the root tag. Look at this


Bindu Lakhanpal wrote:
Question 55
Given a jsp page called index.jsp with the content


And a menu.jsp file available to index.jsp containing
......
What will happen when you attempt to compile and run index.jsp?



The JSP page will cot compile, so you are right.

Bindu Lakhanpal wrote:Ques 62
Following statement is chosen as true:
The taglib directive can use either the tagdir or the uri attribute to locate the tld file.

But tagdir attribute is not for locating tld file.It is for finding tag file.


Seems another mistake to me.

Bindu Lakhanpal wrote:Ques 65
Following statement is chosen as true:
Using classes that implement DynamicAttributes requires that they be declared in the deployment descriptor


Tag class is declared in tld ( in <tag>'s <tag-class> element)even if it does not implement DynamicAttributes interface. So this statement
does not appear accurate.



I think the question is talking about the <dynamic-attributes> tag of the tld. And also the question never says that tag classes that don't implement DynamicAttributes are not declared in the tld...
 
Bindu Lakhanpal
Ranch Hand
Posts: 171
Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ankit.

Question 58
A JSP document (i.e. in XML syntax) must start with the root tag

Answer in mock is: true



The link you sent also says about jsp:root element

Using the jsp:root Element
The jsp:root element represents the root element of a JSP document. A jsp:root element is not required for JSP documents. You can specify your own root element, enabling you to use any XML document as a JSP document. The root element of the books.jspx example JSP document is books.

Although the jsp:root element is not required, it is still useful in these cases:

When you want to identify the document as a JSP document to the JSP container without having to add any configuration attributes to the deployment descriptor or name the document with a .jspx extension

When you want to generate--from a single JSP document--more than one XML document or XML content mixed with non-XML content



So, its confirmed that this element is not mandatory.
 
Ankit Garg
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What I understood from that question (and what I meant in my reply), is that there should be only one root element in a JSP document. I don't think the question is talking about the jsp:root element, it just says any root element, or maybe i understood it wrong, but yes the jsp:root is not mandatory...
 
Bindu Lakhanpal
Ranch Hand
Posts: 171
Flex Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankit Garg wrote:I don't think the question is talking about the jsp:root element, it just says any root element,



Yes, you are right.Question is not talking about <jsp:root>
And we can specify our own root tag like following:

<books xmlns:jsp="http://java.sun.com/JSP/Page">
<jsp:directive.page errorPage="errorpage.jsp" />
...
</books>



I don't really know much about jsp document format.Just as much as in hfsj.
 
Ankit Garg
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bindu Lakhanpal wrote:I don't really know much about jsp document format.Just as much as in hfsj.



And that's what is required for SCWCD ...
 
reply
    Bookmark Topic Watch Topic
  • New Topic