PDA

View Full Version : step-by-step tutorial


ehillmuth
08-12-2004, 01:47 PM
I'm working my way through Part 2 of "Developing a Spring Framework MVC application step-by-step". So far I have only had one show stopper. After completing Step 14, building and deploying I get this error:

2004-08-12 13:01:45 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /index.jsp(1,1) The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
at org.apache.jasper.compiler.DefaultErrorHandler.jsp Error(DefaultErrorHandler.java:39)

(Full stack trace and the end of this message)

I can see that jstl.jar made it to Tomcat because its sitting in ~\webapps\springapp\WEB-INF\lib\

I am using spring-framework-1.1-rc1-with-dependencies and Tomcat 5.0.27. Any pointers would be appreciated.

Full Stack trace:
2004-08-12 13:01:45 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /index.jsp(1,1) The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
at org.apache.jasper.compiler.DefaultErrorHandler.jsp Error(DefaultErrorHandler.java:39)
at org.apache.jasper.compiler.ErrorDispatcher.dispatc h(ErrorDispatcher.java:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspErro r(ErrorDispatcher.java:90)
at org.apache.jasper.compiler.Parser.processIncludeDi rective(Parser.java:339)
at org.apache.jasper.compiler.Parser.parseIncludeDire ctive(Parser.java:372)
at org.apache.jasper.compiler.Parser.parseDirective(P arser.java:475)
at org.apache.jasper.compiler.Parser.parseElements(Pa rser.java:1539)
at org.apache.jasper.compiler.Parser.parse(Parser.jav a:126)
at org.apache.jasper.compiler.ParserController.doPars e(ParserController.java:220)
at org.apache.jasper.compiler.ParserController.parse( ParserController.java:101)
at org.apache.jasper.compiler.Compiler.generateJava(C ompiler.java:203)
at org.apache.jasper.compiler.Compiler.compile(Compil er.java:470)
at org.apache.jasper.compiler.Compiler.compile(Compil er.java:451)
at org.apache.jasper.compiler.Compiler.compile(Compil er.java:439)
at org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:511)
at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:295)
at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invo keInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invo keNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(S tandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(Cont ainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)

Keith Donald
08-12-2004, 02:47 PM
You're likely missing standard.jar in WEB-INF/lib; it's available with the spring with dependencies under lib/jakarta-taglibs/standard.jar.

ehillmuth
08-12-2004, 02:59 PM
Indeed! That did the trick.

Many thanks

jconsult
09-02-2004, 01:37 AM
Hello
I'm exploring the framework by going through the step-by-step tutorial.

I have completed step 14 (Improve the view and the controller), but it doesn't work as it should.

I'm positive that i have the right source (used cut'n'paste), but when i try to run the application i get the output

Greetings, it is now ${now} instead of the time and date which it should display.

I don't want to continue the tutorial before i've found the sollution for this.
Can someone give me a hint what may be wrong?

Regards
Per

tesmerjg
12-13-2006, 09:51 PM
I'm positive that i have the right source (used cut'n'paste), but when i try to run the application i get the output

Greetings, it is now ${now} instead of the time and date which it should display.


For me, this happened when I had the wrong URI for the tag libraries in the "include.jsp" file. I was using:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>, but I should have been using:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

I'm using v2.0.1 of the Spring Framework with dependencies.

JGT

degrade
12-26-2006, 12:39 PM
This may not be the place, but I've been looking around and I can't seem to figure out where to ask. In my controller, I return a ModelAndView and it has a class in the model that I've made with very simple attributes and methods. Normally in a jsp, assuming that I've named my model as "model", I can do ${model.thisclass.id} and that will get me the id from the class. This is nice, but is it possible to use a method from the class in the jsp? I would like to be able to do something like ${model.thisclass.getId()} Is this possible?