Radoslaw Sztando

Ranch Hand
+ Follow
since Mar 11, 2004
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 Radoslaw Sztando

Are tag files with XML syntax covered by SCWCD at all?

I read in Head First Servlets and JSP that tag files allowed extensions are .tag and .tagx
However when I changed name of my very simple tag file from SimpleTagFile.tag to SimpleTagFile.tagx, it stopped working.
Opening JSP which uses this tag file results in

java.lang.RuntimeException: org.apache.jasper.JasperException: Error reading file "/WEB-INF/tags/SimpleTagFile.tagx"

Do I need some additional configuration?
I used EL:


I read page directive specification and it says:

isErrorPage="true | false"
Whether the JSP file displays an error page. If set to true, you can use the exception object in the JSP file. If set to false (the default value), you cannot use the exception object in the JSP file.

However I prepared error page without isErrorPage directive and I still can use exception object in it.
I tried both ways of configuring it as error page (in DD and using errorPage page directive in 'faulty' jsp). I also tried setting isErrorPage implicitly to "false".
It still works!

Is it a matter of Container? I use Tomcat 6.0


I have following structure of webapps dir


I want to
1) have access to list of files and files itself in archive dir when someone goes to URL http://.../Test/archive/
2) no access to list of files and files itself in Test dir

I tried DefaultServlet with listings = true mapped to url = /archive/ in my web.xml. What I achieved is requirement 1) and part of 2) - user cannot list Test dir by going to http://.../Test/
BUT user can still access test.txt by explicitly naming it in URL like http://.../Test/test.txt
How to limit access to this file (and all files in Test dir)?

Thanks in advance!

some time ago I passed SCJP 1.4 and now I'd like to take SCWCD. Do I need to take upgrade exam (to SCJP 5 or 6)?

Why above code does not update column AGE for all records which NAME is null? In normal query I would rather use "...WHERE NAME IS NULL" for this case but I want to have general solution (handling both NULL and not NULL values in WHERE clause). Guys, do you have any idea how to do it?
I can post some code (when I'll get home). Another thing is that I tried to connect COM1 and COM2 using cable and run two Java applications one is writing to COM1 and second is listening on COM2. Sequence was sent correctly - without any additional bytes. So I cannot reproduce it without this specific configuration.

I forgot to mention that electronic device is connected to USB and its drivers simulate it as RS232 port.
15 years ago
Not good :/
What's more when I use standard win32 HyperTerminal I got correct sequence.
15 years ago
InputStream - sorry for confusion.
I read data from InputStream using read() method.
15 years ago

I'm writing an application which communicates with some electronic
device by serial port.
I'm using javax.comm library (class SerialPort).

I wrote some test cases to test if communication works. Device just
sends 128 bytes starting from 0 to 128.
The problem appears that when device sends byte 0x0A application receives two bytes 0x0D and 0x0A.
It looks like Windows end-of-line. Can I somehow modify OutputStream mode (from "ascii" to binary)?

Any help will be appreciated.
15 years ago

I will try this out as soon as possible


I'm reading Head First EJB and I'm trying to see how first example works. I'm using standard j2ee 1.3 server.
I managed to create my first session bean and even succesfully deploy it.
Now I want to write a simple client application which will connect to J2EE server and run business method of my bean.
I copied application from the book but it does not work. As far as I know there is sth wrong with JNDI configuration.

My client App code looks like:
Context ic = new InitialContext();
System.out.println("Looking for component " + name);
Object o = ic.lookup(name);
DoradcaHome ibaz = (DoradcaHome)PortableRemoteObject.narrow(o, DoradcaHome.class);
Doradca doradca = ibaz.create();
}catch(Exception e) {
and it throws exception from ic.lookup(name).
As you can see I haven't configured InitialContext in any way - I just don't know how to do it.

Can anyone help?

Thanks in advance
I guess this is a matter of compliance with common split_your_guts Object.toString().
I can't see any better way to implement toString() for String class.
1) abstract class Feline implements Animal { }
Feline is abstract class. Since it is not concrete it does not need to implement Animal methods.

2) abstract class Feline implements Animal { void eat(); }
eat() in Animal is public (like all methods in interfaces). That's why this won't compile.

3) abstract class Feline implements Animal { public void eat(); }
eat() is not marked abstract, so Feline should provide implementation. But there is not curly braces so there is no implementation. Compilation error.

4) abstract class Feline implements Animal { public void eat() { } }
correct implementation of interface (even if method eat() is not doing much )

5) abstract class Feline implements Animal { abstract public void eat(); }
perfectly ok. Abstract class with abstract method.
abstract public void eat(); is redundant since it is already declared in Animal interface.

Hope it helps.