qd wangqun

Greenhorn
+ Follow
since Jan 11, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by qd wangqun

could you send me the code all of the project on HFSJ page 437,
this is my E-mail: qingdao_wangqun@163.com
thank you very very much!!
when i test the project,it show me

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:411)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:118)
org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:316)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:147)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.



what's the metter?
thanks in advance!!
thank you very much!!
it's my wrong!!
when i test HFSJ page 390 ,it show me the follow:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to initialize TldLocationsCache: XML parsing error on file /WEB-INF/myFunctions.tld: (line 1, col 45)
org.apache.jasper.compiler.TldLocationsCache.init(TldLocationsCache.java:249)
org.apache.jasper.compiler.TldLocationsCache.getLocation(TldLocationsCache.java:220)
org.apache.jasper.JspCompilationContext.getTldLocation(JspCompilationContext.java:475)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:417)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.



so what wrong with it
who could help me ?
thanks in advance!!!
when i run the testJSP1 ,it show "description The requested resource (/testJSP1/) is not available"

thanks in advance!!
congratulations with my best wishes!!!
I think the HFSJ(Head First Servlet & Jsp) is the best guide book for your SCWCD 1.4

Originally posted by marc weber:

There is a constructor for Sub. Because no constructors are explicitly defined for Sub, the compiler inserts a default no-args constructor, which simply calls the no-args version of the superclass constructor.



and thank you too!!
16 years ago

Originally posted by Lukasz Bajzel:
Let us explain what is happening here.

When you call new Sub(), the parent class's (Super) constructor gets invoked. why because, there is no constructor for Sub. So the call propagates in the chain and goes to parents constructor.

Now, when you call abc() in the super class's constructor, the abc() method in Sub is called. Why because remember you invoked new Sub(). But when that call gets executed from the Super's constructor, the variable s1 is not visible.

The result is s1 0

Hope this helps!

Sincerely,
your friends at JavaAdvice.com
http://www.JavaAdvice.com - The one stop resource for all your Java questions and answers

[ January 23, 2008: Message edited by: Lukasz Bajzel ]



Lukasz Bajzel,thank you so much!!!
16 years ago
class Super {
private int s = 100;

Super() {
abc();
}

void abc() {
System.out.println("s " + s);
}
}
class Sub extends Super {
private int s1 = 200;

void abc() {
System.out.println("s1 " + s1);
}


public static void main(String[] args) {
new Sub();
}

}

why the output is "s1 0"
who knows?
thanks in advance...
16 years ago

Originally posted by Christophe Verre:
These are just Java 1.5 warnings. I think that you can ignore them.



Christophe Verre,thank you
problems are solved!
when i compile the cmd,the sys let me compile again with -Xlint:unchecked


thanks in advance