Top.Mail.Ru
September 14th, 2005 - Java developers — LiveJournal
? ?

Java developers

September 14th, 2005

12:04 pm - batigoal - Ant JSP compilation

Hello,

does anybody tried JSP compilation with Ant jspc task? I had a lot of troubles with this and finally came to the following error:

[jasperc] 2005-09-14 11:51:27 - ERROR-the file '\jsp\GetChannelData.jsp' generated the following general exception: java.util.EmptyStackException
[jasperc] java.util.EmptyStackException
[jasperc] at java.util.Stack.peek(Stack.java:79)
[jasperc] at org.apache.jasper.compiler.ParserController.resolveFileName(ParserController.java:419)
[jasperc] at org.apache.jasper.compiler.ParserController.parse(ParserController.java:187)
[jasperc] at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
[jasperc] at org.apache.jasper.JspC.parseFile(JspC.java:385)
[jasperc] at org.apache.jasper.JspC.parseFiles(JspC.java:684)
[jasperc] at org.apache.jasper.JspC.main(JspC.java:699)
[jasperc] java.util.EmptyStackException
[jasperc] at java.util.Stack.peek(Stack.java:79)
[jasperc] at org.apache.jasper.compiler.ParserController.resolveFileName(ParserController.java:419)
[jasperc] at org.apache.jasper.compiler.ParserController.parse(ParserController.java:187)
[jasperc] at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
[jasperc] at org.apache.jasper.JspC.parseFile(JspC.java:385)
[jasperc] at org.apache.jasper.JspC.parseFiles(JspC.java:684)
[jasperc] at org.apache.jasper.JspC.main(JspC.java:699)


The task text:

[target name="compile_JSP_pages" depends="prepare"]
[jspc srcdir="${jsp.dir}"
destdir="${build.dir}"
package="${package.name}"
compiler="jasper"
uriroot="."
verbose="9"]
[classpath]
[pathelement path="${classpath}"/]
[fileset dir="${lib.dir}"]
[include name="**/*.jar"/]
[/fileset]
[/classpath]
[include name="**/*.jsp"/]
[/jspc]
[/target]


May be, anybody can give an advice?
 

12:53 pm - ex_zadoff59 - how to debug JSP

Hi all!
How to debug JSP?

I want to start web server (sun one),
and when web browser sends request i want to see the java code
in debugger (like Eclipse) and execute line by line..

for ex. i have running server writen in c++
i can use gdb to "attach to the process", set breakpoint, ........
so how to attach Eclipce to JSP in the same way?

03:18 pm - shmuelisms - interfaces + instanceof / collection = BAD??

Hello all, while I'm a experienced programmer, I'm pretty new to Java, so I was wondering about this issue I have. Java Practices explains here, why one should avoid the instanceof operator. I fully understand their reasoning, why polymorphism is better. But this makes the hidden assumption that your relevant objects all share a common base class. What if this is not the case??
public interface Foobarable {
    public void foobar();
}
========================================
...
void foobar(List oList) {
    for (Iterator oIter = oList.iterator(); oIter.hasNext(); ) {
        Object listItem = oIter.next();
        if (listItem instanceof Foobarable) 
            ((Foobarable)listItem).foobar();
    }
}
...

Is this "acceptable" usage, given that the List will contain different types of objects, that do NOT share a common base class. Is there a BETTER more elegant way to do this??

EDIT: Fixed class-name typo in final line. Oops.
Powered by LiveJournal.com