File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Examulator mock exam doubts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Examulator mock exam doubts" Watch "Examulator mock exam doubts" New topic
Author

Examulator mock exam doubts

gopal venu
Ranch Hand

Joined: Jan 06, 2006
Posts: 55
Few doubts from marcus green exam :

This taglib is given true <%@ taglib tagdir="/WEB-INF/tags/taglib.tld" prefix="h" %>
I feel tagdir should be valid dir path not file path.
---------------------------------------------------------
One question asking to find valid servlet mapping and one mapping contains this
<url-pattern>*.java</url-pattern>
given wrong comment is : Container not look for extension just map the request url for mapping.(I understand this fact but i selected this answer because its valid URL pattern can support http://mysite.com/myapp/myservlet.java this kind of request )
---------------------------------------------------------
The isUserInRole method makes a comparison with roles defined within the role-link tag of the deployment descriptor
I think this is wrong it comapre with <role-name> not <role-link>
---------------------------------------------------------
Again one question on <jsp:root> must be the root element of JSP Document.
Options: True ,Flase
Given Answer: True
My Answer : False
Because i read somewhere that in JSP 2.0 its not required.

Can you guys please help me on this doubts ??
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
Have you compiled some sample code to check out your assumptions?


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
Muks Sam
Ranch Hand

Joined: Apr 09, 2004
Posts: 47

HI,

Although, I haven't tried any realtime example by coding but I think that <jsp:root/> is not a "must" in below scenes:

1. The request path matches the URL pattern for a web.xml JSP property group declaration with an <is-xml> element set to true. See part two of this series for more on JSP property group declarations.

2. The request path extension is .jspx, unless this extension matches the URL pattern for a JSP property group declaration with an <is-xml> element set to false. In other words, .jspx is the default extension for JSP Documents, but it can be explicitly disabled by a property group declaration.

3. The request path extension is either .jsp or matches a URL pattern for a JSP property group declaration and the root element in the file is <jsp:root>.

Marcus, Pls. have your comments on this.

Please refer following link for ref.

http://www.onjava.com/pub/a/onjava/2004/04/21/JSP2part3.html

Thanks

Muks
Muks Sam
Ranch Hand

Joined: Apr 09, 2004
Posts: 47

Hey Gopal,

Guess what, <jsp:root/> is not required. I already had tomvat-apache with me. There is this example under "/jsp-examples/xml/xml.jsp" which has <jsp:root> in it. I simple removed the tag and re-started the server and there it is the same output from xml.jsp without root tag. So it is confirmed that it is not required.

Let me know if you have any queries,

Thanks

Muks
[ June 19, 2008: Message edited by: Mukul Samak ]
gopal venu
Ranch Hand

Joined: Jan 06, 2006
Posts: 55
Marcus,

I compiled example and came to know :
<jsp:root> it not required (Also I got this in JSP 2.0 Spec)
------------------------------------------------------------

<url-pattern>*.java</url-pattern> is valid i run the example and its working

------------------------------------------------------------

isUserInRole compare with <role-name> as per Spec

------------------------------------------------------------

Regarding taglib i tried to give tld path :



and inside customtag.tld i mentioned tag file



Its still giving translation error as not able to find out tag file.
Similarly i tried this also

<%@taglib tagdir="/WEB-INF/tags/myheader.tag" prefix="mm"%>
this is also not working.

it seems my assumptions are correct, can you please give your feed back on this ?
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
Although, I haven't tried any realtime example by coding but I think that <jsp:root/> is not a "must" in below scenes:

If you are not creating code you are not studying optimally. Almost all people learn by doing not by reading. If you come accross something
you are not certain of, write some code to test it.

You need to read exam questions very carefully. Note the question as follows

"<jsp:root> must be the root element of JSP Document".


Note the use of the term JSP Document (emphasise the word document)

See the following to explain the nature of Documents (JSP pages with fully formed xml structure)

Also it would be very helpful if you quote the number of the qeustions, As you can see from my sig I have hundreds of questions and without that information
I need to scroll through them to find the one you refer to. Generally I include a detailed explanation with the answers for my questions and I'd like to confirm that I explain the point of this question in the answer.

Good luck with your studies and many thanks for picking up on these items, it helps me clarify my work.

Marcus
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
I could have edited that last post to hide my ignorance, but I thought I do a follow up to put it into the "don't believe everything you read on the web no matter how confidently it is written". It turns out that in the move to the 2.4 spec you do *NOT* need to start a JSP document (xml compliant JSP page) with <jsp:root

Again... many thanks for the feedback. I'll fix that question and put in an explanation.

Marcus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Examulator mock exam doubts