Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring Web Services Class Not Found Exception
    primarykey
    data
    text
    <p>I'm going through this Spring tutorial online form springsource.org. </p> <p><a href="http://static.springsource.org/docs/Spring-MVC-step-by-step/part2.html" rel="nofollow">http://static.springsource.org/docs/Spring-MVC-step-by-step/part2.html</a></p> <p>In Chapter 2, at the end, it has you add a bean to prefix and suffix <code>/WEB-INF/jsp/</code> and <code>.jsp</code> to responses. </p> <p>The code so far should basically load index.jsp when you go to localhost:8080/springapp/ which will redirect to localhost:8080/springapp/hello.htm which creates an instance of the HelloController which should in theory send you over to /WEB-INF/jsp/hello.jsp. When I added the prefix/suffix bean and changed all my references to just "hello" instead of the fully pathed jsp file, I started getting the following error:</p> <pre><code>message Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/fmt/LocalizationContext </code></pre> <p>I've tried going back through the samples several times and checking for typo's and I still can't find the problem. Any tips or pointers?</p> <p>index.jsp (in the root of the webapp:</p> <pre><code>&lt;%@ include file="/WEB-INF/jsp/include.jsp" %&gt; &lt;%-- Redirected because we can't set the welcome page to a virtual URL. --%&gt; &lt;c:redirect url="/hello.htm" /&gt; </code></pre> <p>HelloController.java (minus the imports and package:</p> <pre><code>public class HelloController implements Controller { protected final Log logger = LogFactory.getLog(getClass()); public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String now = (new Date()).toString(); logger.info("Returning hello view with " + now); return new ModelAndView("hello", "now", now); } } </code></pre> <p>My hello.jsp file:</p> <pre><code>&lt;%@ include file="/WEB-INF/jsp/include.jsp" %&gt; &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Hello :: Spring Application&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Hello - Spring Application&lt;/h1&gt; &lt;p&gt;Greetings, it is now &lt;c:out value="${now}" /&gt;&lt;/p&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload