开发者

Spring-mvc : serving JSP that was already statically included in another loaded jsp

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 开发者_JAVA百科different JSP, I get this error


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"/>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜