P
phillip.s.powell
Consider this code:
<%
MailAdminReader mar = new MailAdminReader();
boolean hasMail = false;
Thread t = new Thread(new Runnable() {
public void run() {
try {
hasMail = mar.checkForMail();
} catch (Exception e) {
// NO RESPONSE - hasMail REMAINS FALSE
}
}
});
t.start();
t.join(5000);
%>
This section of code should throw a compilation error "variables must
be declared final" on "mar" and "hasMail".
But here's the problem: they're in a JSP. How in the world do I
declare these variables "final" when there is no class reference that
can be declared final? DO I use a block or can I? I am lost here.
Thanks
Phil
<%
MailAdminReader mar = new MailAdminReader();
boolean hasMail = false;
Thread t = new Thread(new Runnable() {
public void run() {
try {
hasMail = mar.checkForMail();
} catch (Exception e) {
// NO RESPONSE - hasMail REMAINS FALSE
}
}
});
t.start();
t.join(5000);
%>
This section of code should throw a compilation error "variables must
be declared final" on "mar" and "hasMail".
But here's the problem: they're in a JSP. How in the world do I
declare these variables "final" when there is no class reference that
can be declared final? DO I use a block or can I? I am lost here.
Thanks
Phil