aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubts from Marcus Green Mock Exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Doubts from Marcus Green Mock Exam" Watch "Doubts from Marcus Green Mock Exam" New topic
Author

Doubts from Marcus Green Mock Exam

Bindu Lakhanpal
Ranch Hand

Joined: Oct 17, 2008
Posts: 165

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.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9302
    
  17

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...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Bindu Lakhanpal
Ranch Hand

Joined: Oct 17, 2008
Posts: 165

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

Joined: Aug 03, 2008
Posts: 9302
    
  17

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

Joined: Oct 17, 2008
Posts: 165


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

Joined: Aug 03, 2008
Posts: 9302
    
  17

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 ...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubts from Marcus Green Mock Exam