Terrence White

Ranch Hand
+ Follow
since Jun 26, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Terrence White

Can someone tell me why this code results in a ClassCastException?


Does anyone know if the RMH book for the SCDJWS exam has a website that list errors?
I got it to work by placing the property under this location:

Application Servers > server1 > Process Definition > Java Virtual Machine > Custom Properties

I am now able to access my property like this in my code:




If I place it in this location:

Application Servers > server1 > Custom Properties

I cannot access the property using System.getProperty()

How do you access yours?
20 years ago
Does anyone know how to set a system property (-D options) in the WAS 5.0
server?

I have it set in my test server on WSAD under the environment tab under
system properties.

When I move to my real server, WAS, I am not sure where to set it.


Thanks,
Terrence
20 years ago
I noticed that the redbook covers WSIF and WSIL.
Are these on the 288 test as well?
I was going through Edurado Cobian's practive exam today and on number 25, he comments:


As far as I know you can't print from doAfterBdoy in a TagSupport handlers.


Is this true? I thought that you could print from any method.
On the SCWCD test, do we need to know all the different names that a design pattern can go by?

For example, The Value Object is also known as the Replicate Object and Data Transfer.
The Data Access Object is also known as the Data Access Component.
etc..
Thanks,
Terrence
Question from ]http://www.javaranch.com/carl/SCWCD.htm


Question 25)
Given the following tag handler defined with <bodycontent>JSP</bodycontent>
public class body extends TagSupport {
public int doStartTag() throws JspException{
return EVAL_BODY_INCLUDE;
}
public int doAfterBody() throws JspException {
try { pageContext.getOut().print("how are you?"); }catch(IOException e) {}
return SKIP_BODY;
}
}
what will be printed out by the following part of a jsp page?
<prefix:sufix>
<i>Hello</i>
</prefix:sufix>
1) The tag handler won't compile.
2) The jsp page will print Hello how are you?
3) The jsp page will print how are you? Hello
4) The jsp page will print Hello

The stated answer is:
4) The jsp page will print Hello
As far as I know you can't print from doAfterBdoy in a TagSupport handlers.



Is this correct?
Can you have parameters and headers in the same request URL?
If so, would you put the parms first or the headers?
I am trying to understand how to send parameters to a servlet using the url string.
I have seen the following.
http://server.name.com/webappName/servletName/pathInfo?paramName=value¶mName=value2
Since the ? mark is used to indicate a paramater list, what does the semicolon ; mean.
I saw this in the SCWCD Exam Study Kit on page 127:
<a href="/servlet/AccountServlet;JSESSIONID=C084B32241...114">
Should this read:
<a href="/servlet/AccountServlet?JSESSIONID=C084B32241...114">
Thanks for clearing that up for me.
On page 323 (Table 16.8, chaper 16) of the SCWCD Exam Study Kit, the author states that the EVAL_BODY_BUFFERED constant can be returned by doStartTag() and doAfterBody(), for tags that implement the BodyTag interface.
Is that really true?
I cannot find proof of this in the Servlet API nor the servlet spec.
From reading these, I am led to belive that only IterationTag.EVAL_BODY_AGAIN or Tag.SKIP_BODY can be returned by doAfterBody(), even when the tag implements the BodyTag interface. Am I correct?

I am studying for the 1.3 test, not the 1.4 beta, so I am only looking at version 1.2 of the JSP spec.
The read() method of InputStream blocks until input data is available.
How can I set up this condition on a file?
Will a 0 byte file do?
20 years ago
Is it possible for me to write code that will execute as soon as a file is placed into a particular directory?
I want to avoid writing code that will loop over and over again, checking for the existence of the file.
Does Java have listeners that could tell me when a file has been sent to me?
Thanks
20 years ago
Is there a way for me to place jars inside of an executable jar and get it to run?
When I put them inside of my executable jar, the files cannot be found, and I get the infamous "java.lang.NoClassDefFoundError" error.
How can I get the classpath to look into the executable jar?
I tried editing the manifest:
Class-Path: firstFile.jar secondFile.jar
But this only works if the jar files are in the same directory as the executable jar.
My jar files are inside of the executable jar.
21 years ago