0

JSTL not working after adding following lines to web.xml

    <servlet>
     <servlet-name>jsp</servlet-name>
     <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param> 
        <param-name>mappedfile</param-name>
         <param-value>false</param-value>
    </init-param>
    <load-on-startup>3</load-on-startup>
 </servlet> 

It shows the following exception while moving to the jsp where jstl is included.

org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application Although the jstl is at the class path. Also I dont want to remove the changes in web.xml

Ankit Duggal
  • 55
  • 2
  • 13
  • 1
    Please check the version of `JSTL` used, how are you injecting `Jstl`, through `POM`, What is the import for `jstl` you have used inside `jsp` page – Ankur Singhal Jul 20 '15 at 10:39
  • Did you edit it in Tomcat's own web.xml, or did you copy that in your webapp's web.xml? – BalusC Jul 20 '15 at 11:08
  • @ankur-singhal JSTL version is proper as prior to injecting the code in web.xml The jsp is working properly – Ankit Duggal Jul 20 '15 at 11:24
  • @BalusC it is part of my webapp's web.xml and I am using Jboss 5.1.0 Server not Tomcat – Ankit Duggal Jul 20 '15 at 11:26
  • 1
    You're not supposed to duplicate server's own JSP servlet in webapp's `web.xml`. This is recipe for trouble (although I can't confirm if broken JSTL is indeed one of the consequences, I haven't seen this kind of symptom yet). You should reconfigure it in JBoss itself. Try following the instructions described here: http://www.techstacks.com/howto/remove-the-x-powered-by-header-in-jboss.html – BalusC Jul 20 '15 at 11:35
  • @BalusC the above parameters are added because of the following reason- http://stackoverflow.com/questions/7495985/byte-limit-exceed-problem-when-reloading-a-jsp-page/26647081#26647081 One of my jsp file is exceeding the limit. I reffered above link for this. – Ankit Duggal Jul 20 '15 at 12:12
  • The xpoweredby header part is not relevant, just the way how you edit JBoss default JSP servlet is relevant. Follow the same guideline for editing any of JBoss default JSP servlet configuration. – BalusC Jul 20 '15 at 12:32
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/83745/discussion-between-ankit-duggal-and-balusc). – Ankit Duggal Jul 20 '15 at 12:35
  • I have removed xpoweredBy and fork init param but I require mapped file as false because one of my jsp is exceeding the limit. – Ankit Duggal Jul 20 '15 at 12:47
  • You are really not understanding me? I will say this once more and for the last time: You're not supposed to duplicate server's own JSP servlet in webapp's `web.xml`. This is recipe for trouble. You should reconfigure it in JBoss itself. – BalusC Jul 21 '15 at 07:27

0 Answers0