wood burning stoves 2.0*
The moose likes JSP and the fly likes web.xml change not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "web.xml change not working" Watch "web.xml change not working" New topic
Author

web.xml change not working

Carl Jenkins
Ranch Hand

Joined: Feb 19, 2006
Posts: 39
Hi all!

I made the web.xml change according to the faq, deployed my app and restarted my server, but my EL still displays as plain old html text on the page.

Could someone please tell me what I could be missing here?
When I run the examples provided with Tomcat their EL runs fine...

Thank you
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
Double check that the changes you made have been applied.
Are you deploying via a WAR or just copying files into place?
If using a WAR, it is generally safer to delete the "exploded" directory that Tomcat creates, so that you can be certain it gets the latest version.

What you might also try is putting this on your JSP page:
<%@ page isELIgnored="false" %>
This suggestion is more in the way of "try this and see if it works". The best approach is to get web.xml correct.

What have you got in web.xml now?
Carl Jenkins
Ranch Hand

Joined: Feb 19, 2006
Posts: 39
I am using a simple ant script to deploy to the webapps dir of tomcat.
I added the line you mentioned <%@ page isELIgnored="false" %> to the jsp and that didn't help I am at a loss right now I know it's something simple I am missing (it usually is).

I have my JAVA_HOME & CATALINA_HOME variables set and also my CLASSPATH is set so the servlet-api.jar file is there. Any further ideas?

Thanks for the help...
venkatesh padmanabhan
Greenhorn

Joined: Feb 17, 2006
Posts: 20
Try this web.xml file

Carl Jenkins
Ranch Hand

Joined: Feb 19, 2006
Posts: 39
Still not working...here is what I have

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">

<display-name>Web Application</display-name>
<description>
This is version X.X of an application to perform
a wild and wonderful task, based on servlets and
JSP pages. It was written by Dave Developer
(dave@mycompany.com), who should be contacted for
more information.
</description>



<context-param>
<param-name>webmaster</param-name>
<param-value>myaddress@mycompany.com</param-value>

</context-param>


<servlet>
<servlet-name>ShowHeadersServlet</servlet-name>
<servlet-class>com.carljenkins.controller.ShowHeadersServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>ShowHeadersServlet</servlet-name>
<url-pattern>/ShowHeadersServlet</url-pattern>
</servlet-mapping>

<session-config>
<session-timeout>30</session-timeout> <!-- 30 minutes -->
</session-config>



</web-app>
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
Looks ok to me.

Just for completeness, what server are you using (version as well)
And what version of java?
Heres a basic test page.


Also check up that your ant file is actually doing what you want it to (ie the files are getting updated in place correctly) Maybe try changing them directly in the webapps directory?
Carl Jenkins
Ranch Hand

Joined: Feb 19, 2006
Posts: 39
Well like another poster who was having a similar problem I decided to download a fresh version of tomcat5.5 and everything works just splendid now.

Thanks for all the assistance everyone!
This forum rocks!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: web.xml change not working
 
Similar Threads
JSP2.0 Expression Language web.xml setting
el code showing on web page
How do i correct this error
Error page configured in web.xml not working
JSTL tags not recognized