Ramesh Ponnada

Greenhorn
+ Follow
since Nov 05, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ramesh Ponnada

I am seeing that in the very same status since atleast a year
Its similar to below :

<%= new Date() %>

This jsp can be included in another jsp page in which java.util.Date is imported, which is perfectly valid.

So I think this is one of the reasons why translation just do as is copy of statements into servlet.
IDEs like eclipse, netbeans can have schema validation enabled.
Because init-param is not a part of servlet-mapping it schema validation fails and eclipse reports it as a error in the problems view.
(one can disable the validations in the eclipse preferences)


Also, if you have XML-Validation turned on in the container(I am taking about Tomcat, I don't know how to do it in others) web application won't start/load.
[ August 11, 2008: Message edited by: Ramesh Ponnada ]
Both 1 & 2 are correct answers.
init-param tag is part of <servlet> not <servlet-mapping>

So, above code will print 2 nulls.
menu.jsp has a compilation error, as variable greeting is not defined in its scope.

you'll get a 500 (Internal Server Error) which is caused by this compilation error.

I am not totally convinced with answer D, but its the closet one so will go with it.
Just curious, is there any difference between JSP page and JSP document ?


yes its perfectly valid to give this as servlet name.

And coming to the above question, I guess we are missing something is it the complete question. can you please post the full question.
[ August 07, 2008: Message edited by: Ramesh Ponnada ]
Thanks guys,

Explanation really helped in understanding what are compile time constants.





Question:

Both variables a and b are compile time constants as they are declared as final, even then why Compiler is complaining this way.
[ December 19, 2007: Message edited by: Ramesh Ponnada ]
myObject.doSomth(1);

-- compiler complains there is no method like doSmith(int).

My guess is when comes to method arguments a number literal is always int, as the compiler will not know whether to cast it to a short or a byte (if you have 2 overloaded methods).