Andrew Rigsby

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

Recent posts by Andrew Rigsby

The thread pool executor takes a blocking queue as its argument (i.e. the work queue) which according to the API’s is used for “… holding tasks before they are executed”

If a thread pool executor is permitted a maximum of 2 threads and has a fixed size work queue of 1 ….. if the main thread calls submit() twice before one of the pooled threads has a chance to execute will this result in the second call to submit() throwing an exception because of the size of the work queue being exceeded.

I’m just slightly confused by the following description from the API:

• If fewer than corePoolSize threads are running, the Executor always prefers adding a new thread rather than queuing.
• If corePoolSize or more threads are running, the Executor always prefers queuing a request rather than adding a new thread.
• If a request cannot be queued, a new thread is created unless this would exceed maximumPoolSize, in which case, the task will be rejected.

As “fewer than corePoolSize threads are running”, i.e. no threads are running, does the work queue actually get used (and so is its size relevant)?
I'm trying to add components to the JSF tree at runtime within an event listener but the added components aren't displayed. My code is as follows:

*** jsp page ***
<h:form id="jsfForm">
<h:commandButton type="submit" value="Submit" immediate="true" action="#{actionBean.processAction}">

*** actionBean.processAction implementation ***
FacesContext fContext = FacesContext.getCurrentInstance();
Application app = fContext.getApplication();
UIViewRoot view = fContext.getViewRoot();

UIComponent form = view.findComponent("jsfForm");
HtmlOutputText newComponent = (HtmlOutputText) app.createComponent("javax.faces.HtmlOutputText");

return "success";

Could anyone suggest why the added HtmlOutputText component isn't displayed?
15 years ago

I'm considering taking the SCDJWS exam but before I did I wanted to know how recent the current version of the exam is and whether SUN have any plans to change/update the exam in the near future?


Thanks!! That was very useful!!

One more thing, what are Mikalai's notes?
I've seen that SUN have now made available the official SCBCD 5.0 exam.

Does anybody know of any good books that would prepare you for the exam? Also, is there a 'Head First' book for this exam in the pipeline?

So, if asked in the SCWCD exam whether request scoped attributes are thread safe the answer is 'Yes'.

Do you need to consider the fact that a reference to the request attribute may be being used in another part of the application in the exam?
Are request scoped attributes thread safe?

I originally thought they were until I read an article on the Internet which seems to have confused me! Can anyone clarify this for me?

For simple tags implementing the SimpleTag interface, the setParent() method is only called when a tag has an enclosing parent.

Is this also the case for classic tags? In other words, is the Tag.setParent() method only called when a tag has an enclosing parent or is the method always called?


Is it possible to have two <error-page> declarations in the DD for the same error-code or exception-type?

For example, if you have the following:



... which error page is displayed?
For the SCWCD exam, are you tested on the deprecated classes and methods e.g. HttpSession.putValue(), HttpSession.getValue() etc?
Yeah, that's more or less what I have:

<web-app id="WebApp_ID" version="2.4" xmlns="" xmlns:xsi="" xsi:schemaLocation="">

I'm using Tomcat 5.5.
When you define authentication in the deployment descriptor using the following:

<auth-method>BASIC | DIGIST | FORM etc... </auth-method>

... how do you 'log out' the user once they have been authenticated so that another user can login and authenticate?

The reason I ask is because once I've authenticated one user I don't know how to terminate the users session so that another user can login.

I've checked the version of my web.xml and it specifies 2.4. Tomcat still continues to load the servlet with a <load-on-startup> of 1 before the servlet with a <load-on-startup> of 0.

I've read that the <load-on-startup> element allows you to specify that a servlet is loaded at deployment time if it defines a value greater than 0. However, I've also read that it allows you to specify the order of servlet loading.

What I wanted to know was that if one servlet has a <load-on-startup> value of 0 and another servlet has a value of 1, which is loaded first?

I assumed it would be the servlet with the lower value, i.e. 0, but when I try it out in Tomcat the servlet with the <load-on-startup> of 1 loads first?


I understand that when a request is made to a web application's servlet, the request is delegated to the web container by the web server. The container then locates the relevant servlet class, creates the HttpServletRequest & HttpServletResponse objects and allocates a thread for the request.

What I wanted to know was ... does each web application run in a seperate instance of the web container or does a single web container manage all web applications?