How to use JSTL 1.2 on Tomcat 8? - jstl

I want to use JSTL 1.2 in my Tomcat 8 web app. I continue to get 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. None of the other answers on the internet solve this problem for me.
I have verified that the jstl-1.2.jar is in my web app's WEB-INF/lib folder and my JSP has the newer, <%# taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> declared at the top.
If I open the jstl-1.2.jar file with 7zip, I can clearly see the c.tld file inside the META-INF folder and within that file I can even see this line: <uri>http://java.sun.com/jsp/jstl/core</uri>.
I am not using maven, just copying jars into the WEB-INF/lib folder as needed.
My web-app's web.xml file specifies it is web-app version 3.1
What else can I do to troubleshoot this? Also, is there any modern documentation on using JSTL? Oracle's docs end up here, which has almost no details on using JSTL, or even how to get it.
Webapp structure:

In my case, Tomcat's catalina.properties file had the jarsToSkip setting at \*.jar, so no jars would be scanned, resulting in quicker startup. To override this, I added taglibs*.jar (my jars were called taglibs-standard-impl-1.2.5.jar and taglibs-standard-spec-1.2.5, so it picked both up) to the jarsToScan setting below it, which fixed the problem.
I'm guessing that if jars aren't scanned, taglibs can't be found.
Tomcat's page has a nice write up of using taglibs here with a helpful readme.

Related

Can not find the tag library descriptor for "http://www.springframewrok.org/tags/form/"

Can not find the tag library descriptor for "http://www.springframewrok.org/tags/form/"
i am getting this error on my jsp page though i have imported all the spring jar and also the dependent jars , i have also imported taglib.jar but still facing error. all my jars resides inside the /WEB-INF/lib folder in a dynamic web project.
could anyone tell me the reason behind it.
Thanks in advance..
i can show my project directory structure if anyone needed..just ask me .

How to disable caching of jsp (and static resources) at META-INF/resources in Tomcat 7 (servlet 3.0)?

I've tried to set the cachingAllowed to false at both context.xml and server.xml.
And I use the default Context (org.apache.catalina.core.StandardContext).
But Tomcat still ignores modifications in dependencies jars within WEB-INF/lib (changes in jsp or js at META-INF/resources have no results).
I've tried to delete the Work folder with no success.
Dos anyone knows a way to turn off this caching?
This is for dev purpose of quickly change the resources (jsp reloading) and see the result without restart Tomcat.
I used to use war overlays and I am trying to migrate to servlet 3.0.

Adding MIME definitions to Trinidad

I'm using the trinidad gem to host my jruby application.
However, any requests for .woff or .ttf font files are met with 400 Bad Request.
When I was jar-ing up my project with warbler and dumping the jar file in a regular Tomcat instance, I was able to add the MIME type definitions for those extensions in the web.xml.
However, I do not know how to do this for the instance of Tomcat that the trinidad gem uses, and the documentation doesn't appear to list it. It does mention specifying a web.xml file to use as a default for the web applications, but that appears to be the one that's placed in the WEB-INF folder and the server doesn't start when I put in Tomcat's conf/web.xml file for it.
I've also tried adding the following lines to config/initializers/mime_types.rb:
Mime::Type.register "application/x-font-woff", :woff
Mime::Type.register "application/octet-stream", :ttf
but this doesn't appear to affect the public folder (and I'd be surprised if it did...).
Where can I find how to do this?

Maven Grails web.xml

Might be a stupid question, but in my current maven project i do not have a web.xml in my /web-app/WEB-INF folder.
There is no web-xml in my project and never has been, im trying to add it but my application is non-responsive to anything written in the web.xml. What am i missing?, iv tried specifying the path to it through the config.groovy like:
grails.project.web.xml="web-app/WEB-INF/web.xml"
Am i missing something? Do i need to specify the web.xml in some other config file in order to make my project utilize it ?
Run
grails install-templates
to copy templates that Grails uses for all code generation activities (including "web.xml").
"web.xml" file will be created in "src/templates/war" directory.
You may be able to get away with something similar to this https://stackoverflow.com/a/5891646/107847. It doesn't install separate web.xml but does allow you add what ever content you need or edit any of the generated content.

Clear web pages cache in jboss

I develop a web app:
frontend javascript
transport json
backend Java EE
JBoss AS 6.1
All static html and js files are in an exploded .war directory which itself is in an exploded .ear directory.
Normally everything works fine! Today I changed a html file and copied it to the .war directory.
When the browser loaded the file it was the old one. So I started wireshark and saw in wireshark the get request and the returned OLD file, even when I changed the filename in the .war directory.
So there is some caching in jboss. I started Googling and found some posts about the tmp and work folders.
I looked in my "...\server\default\work..." folders, but everything was empty.
In "...\server\default\tmp" I found some files but no one seems to be related to my cached page.
As this is a tomcat-in-jboss issue, you have to go to the tomcat area in jboss.
In my case ..\server\default\deploy\jbossweb.sar. In this directory you should find a file called context.xml.
Now stop jboss.
In the context tag there are 2 attributes - cookies and crossContext. Now just add the attribute cachingAllowed="false" and start jboss again:
<Context cookies="true" crossContext="true" cachingAllowed="false">
If you need only one time solution, just create fresh ear with fixed HTML file, undeploy the old one and deploy the new one.

Resources