1

is this possible? I'm loading a JSP that statically includes a jsp fragment. Then I use ajax to reload only the jsp fragment, but I get

Caused by: org.apache.jasper.JasperException: Unable to load class for JSP
        at org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:630)
        at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:149)
        ... 143 more
Caused by: java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.jsp.customers.biddingRoomSearchContainer_jsp
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
        at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
        at org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:628)
        ... 144 more

EDIT: I'm using handler annotation mapping and InternalResourceViewResolver that uses JstlView ... Kinda standard setting for JSP view layer ... And if the handler returns a viewname of JSP that was already statically included into a different JSP, I get this error

lisak
  • 21,611
  • 40
  • 152
  • 243
  • How are you associating the URI path with the JSP fragment? If you don't need a controller for the JSP fragment, then you can use in the Spring XML config. – nickdos Mar 09 '11 at 03:49
  • So if you comment out the then the Ajax request for the fragment works as expected? – nickdos Mar 10 '11 at 05:51
  • is dynamic, I'm talking about static includes <%@ include %> (compilation time includes) ... And yes, thats exactly what happens. – lisak Mar 10 '11 at 10:15

1 Answers1

0

Decided to turn my comment into an answer...

In order to load the JSP fragment via Ajax, you need to associate a URI path with the JSP file. Assuming you don't need to go via a controller (none was mentioned in the question), then you can use the mvc:view-controller feature in Spring 3.0.

In your case it might look something like:

<mvc:view-controller path="/foo/biddingRoomSearchContainer" view-name="/WEB-INF/jsp/biddingRoomSearchContainer.jsp"/>
nickdos
  • 8,348
  • 5
  • 30
  • 47