• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about jsp:forward

 
Jessid Leon Velez Gutierrez
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends. I have a doubt about a question in examulator.com, specifically number 6 in the "JSP standard actions quiz".

Here it is the question:

Given a jsp page called index.jsp with the content


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


(I don't know why in the forum I see twice the word greeting in menu.jsp, one in red an one in blue before the "=" symbol. Just ignore this error)

What will happen when you attempt to compile and run index.jsp?
The correct answer is that it will compile and a runtime error will occur...

But in fact, I think this will not even compile, due to the variable called greeting, is not defined in menu.jsp ...
Well, I can see that they explicitly ask about index.jsp, but seems to me a little ambiguous...

1. am I wrong?
2. could this kind of questions be on the real exam?
3.If so, will I have to take literally what the question asks about?

I know this is kind of stupid question...anyway you have much more experience than I have...

Thanks a lot
 
Dieter Quickfend
Bartender
Posts: 543
4
Java Netbeans IDE Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep. Compilation error.
 
Piotr Nowicki
Ranch Hand
Posts: 611
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Jessid!

Firstly - did you try to run the example on your own? I guess so, as you spotted the compilation error, and it's true - if these are the exact files the question mentioned about - than a compilation error will occur.

Secondly - this kind of question is hardly possible to be present at the exam, but you should be very suspicious all the time. Also note that on the real exam (SCWCD 6) I personally bumped into (at least) two questions which source code won't even compile (!) and it was obvious that there was a mistake in the question (missing DD element, missing parenthesis etc.) because there was no 'compilation error' option. So be extra careful in such cases!

I would advice you to firstly assume that you are wrong and the question is prepared correctly. If you are 150% sure that the code is wrong because there is no correct answer, choose the one that best suits you (i.e. assume what the question is supposed to ask you about, what the author is trying to test you for, etc.). Just remember that this is really the last resort just to avoid receiving 0 points for not giving any answer.

Cheers!
 
Jessid Leon Velez Gutierrez
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Pedro. thanks a lot for your answers. I have gotten the idea.... I hope to do it well in the exam

Pedro Kowalski wrote:Hello Jessid!

Firstly - did you try to run the example on your own? I guess so, as you spotted the compilation error, and it's true - if these are the exact files the question mentioned about - than a compilation error will occur.

Secondly - this kind of question is hardly possible to be present at the exam, but you should be very suspicious all the time. Also note that on the real exam (SCWCD 6) I personally bumped into (at least) two questions which source code won't even compile (!) and it was obvious that there was a mistake in the question (missing DD element, missing parenthesis etc.) because there was no 'compilation error' option. So be extra careful in such cases!

I would advice you to firstly assume that you are wrong and the question is prepared correctly. If you are 150% sure that the code is wrong because there is no correct answer, choose the one that best suits you (i.e. assume what the question is supposed to ask you about, what the author is trying to test you for, etc.). Just remember that this is really the last resort just to avoid receiving 0 points for not giving any answer.

Cheers!
 
Piotr Nowicki
Ranch Hand
Posts: 611
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good luck then! :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic