Robie tutorial z oficjalnej strony Springa i od rana borykam sie z dosc irytujacym problemem. Staram sie robic wszystko po kolei tak samo jak na stronie ale np odnosnie bibliotek springa to ani w spring 2.5 ani w spring 3.1 nie ma common-libs.jar poradzilam sobie z tym pobralam z innej strony i wszystko smigalo. Doszlam do 2 czesci gdzie do gry wchodzi jstl i po dodaniu jstl-1.2.jar (potem jeszcze standard.jar ale podobno przy tej wersji jstl to nie potrzebne) i wprowadzeniu kodu to raz ze mam wrazenie ze po prostu tego jstla nie wykrywa( a mam pliki w katalogu WEB-INF/lib tez ) a dwa ze mi nie dziala jak w tomcacie uruchamiam. Wyswietlam odpowiednio pliki jakie mam i blad.
/WEB-INF/jsp/header.jsp
<%@ page session="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
/WEB-INF/jsp/hello.jsp
<%@ include file ="/WEB-INF/jsp/header.jsp" %>
<html>
<head><title>HELLO : Spring Application</title></head>
<body>
<h1>Hello - Spring Application</h1>
<p>Hey! jest teraz: <c:out value="${now}"/></p>
</body>
</html>
/WEB-INF/index.jsp
<%@ include file = "/WEB-INF/jsp/header.jsp" %>
<%@ page isELIgnored="false" %>
<%-- Redirected because we can't set the welcome page to a virtual URL. --%>
<c:redirect url="/hello.htm"/>
/WEB-INF
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<servlet>
<servlet-name>springapp</servlet-name>
<servlet-class>jstl.demo.JSTLDemoServlet</servlet-class>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springapp</servlet-name>
<url-pattern>*.htm</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
</web-app>
/WEB-INF/springapp-servlet
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/beans/spring-beans-3.5.xsd">
<!-- the application context definition for the springapp DispatcherServlet -->
<bean name="/hello.htm" class="springapp.web.HelloController"/>
</beans>
A blad jaki mi sie obecnie pokazuje to:
Exception report
message Servlet.init() for servlet springapp threw exception
description The server encountered an internal error (Servlet.init() for servlet springapp threw exception) that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet.init() for servlet springapp threw exception
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
java.lang.Thread.run(Thread.java:679)
root cause
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [springapp.web.HelloController] for bean with name '/hello.htm' defined in ServletContext resource [/WEB-INF/springapp-servlet.xml]; nested exception is java.lang.ClassNotFoundException: springapp.web.HelloController
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1262)
org.springframework.beans.factory.support.Abstr................................
Dałoby rade się jakoś pomóc:)?