Sunday 15 June 2014

java - JSP exception when I try to import static file -


I'm trying to import the JavaScript from a file in my Jesp used to be a line of script Can:

  & lt;% @ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core"% & gt; & Lt; Script & gt; & Lt; C: import url = "/ path / to / file.js" /> & Lt; / Script & gt;   

The above code works 99% of the time, but I Tnkt give such notice some errors in the log:

  Jun 20, 2013 1 : 25: 33 AM org.apache.catalina.core.ApplicationDispatcher serious call: org.apache.taglibs.standard at 304 /path/to/file.js: servlet jsp the Servlet.service (for) exceptions javax.servlet.jsp on .JspTagException threw .tag.common.core.ImportSupport.acquireString org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag (ImportSupport.java:171) (ImportSupport.java:329) org.apache. Jsp.WEB_002dINF at jsp.common.head.scripts_jsp._jspx_meth_c_005fimport_005f0 (scripts_jsp.java:182) org.apache.jasper.runtime at org.apache.jsp.WEB_002dINF.jsp.common.head.scripts_jsp._jspService (scripts_jsp.java : 85) On and organization .HttpJspBase.service (HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service (HttpServlet.java:728) (JspServletWrapper.java:432) on org.apache.jasper.servlet.JspServletWrapper.service . apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:390) org.apache.jasper.servlet.JspServlet.service (JspServlet.java:334) javax.servlet on org.apache.catalina.core.ApplicationFilterChain.internalDoFilter. on http.HttpServlet.service (HttpServlet.java:728) (Java ApplicationFilterChain: 305) org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:210) on org.apache.catalina.core.ApplicationDispatcher.invoke (ApplicationDispatcher.java:749) at org.apache.catalina at. core.ApplicationDispatcher.doInclude org.apache.catalina.core.ApplicationDispatcher.include (ApplicationDispatcher.java:544) on org.apache.jasper.runtime.JspRuntimeLibrary.include (ApplicationDispatcher.java:605) (JspRuntimeLibrary.java:954) on org.apache.jsp.WEB_002dINF.jsp.game_jsp._jspService (game_jsp.java:181) at org.apache.jasper.runtime.HttpJspBase.service (HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service (HttpServlet.java:728) on .JspServlet.serviceJspFile org.apache.jasper.servlet.JspServlet.service on org.apache.jasper.servlet on org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:432) (JspServlet.java:390) (JspServlet.java:334) .......   

I found the code that throws the above exception ImportSupport.java:

  // inappropriate to JSTL space Make foreplay reject code (irw.getStatus () & lt; 200 || Irw.getStatus () & gt; 29 9) {new Jesp Teng Akspesheshn (Irv .getStatus () + "+ + strip session (Lcshyuarel)); }   

It seems that the servicelet response code is 304.

Why is the question? Is this a bug or am I missing something?

Update:

The problem only occurs when the incoming request is modified-

Update 2:

I solved this problem - since removed the static files and removed the header from each request.

itemprop = "text">

I have been using ResourceHttpRequestHandler of Spring MVC (with MVC configured: resource) using my fixed resources By serving / processing / * and it returns 304 returns to incoming requests, which use-modified-as headers. If there is an import and incoming request since the modified header I get javax.servlet.jsp.JspTagException :: So when I include such a static resource with C Error 304

I have a choice, including the dynamic @, is not an option, and uses resources in an illegal manner in JSP, in which the resource is attempting to incorporate the URLs operated by the HTTPPequesthandler. So I was included in my own writing which reads from the file and writes it in JSP:

  & lt;% @ page import = "org.springframework.web.context .support. SerialcontactRSourceloader, org.springframework.core.io.Resource "%> & Lt;% @ Page Import = "org.apache.commons.io.IOUtils"%> & Lt;% string path = "/resources/fileName.html"; ServletContextResourceLoader Loader = New ServletContextResourceLoader (getServletConfig). GetServletContext ()); Resource processing = loader.getResource (path); IOUtils.copy (contentResource.getInputStream (), pageContext.getOut ()); & Gt%;    

No comments:

Post a Comment