It's not a secret anymore!*
The moose likes JSP and the fly likes JSTL & Servlet-mappings in web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL & Servlet-mappings in web.xml" Watch "JSTL & Servlet-mappings in web.xml" New topic
Author

JSTL & Servlet-mappings in web.xml

Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Quite simply, would anyone have any idea why including my servlet-mappings into my web.xml is causing the following error in my JSP?

If I take them out it works fine but obviously then, none of my Servlet calls work. Put it back I get this error (sorry it's quite a biggy)!






[ November 16, 2007: Message edited by: Keith Seller ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

My first suggestion is to learn to pare down your posts to relevant parts. Posting pages and pages of stack trace rather than just the important portions is likely to turn people away.

Secondly, why are you declaring the JSTL taglibs in your web.xml? It is unnecessary and just contributes to the noise. Just plop the JSTL jars in WEB-INF/lib and use the appropriate URIs on the pages to reference them.

Did you really remove the ,tld files from their jars and put them in a folder named WEB-INf/tlds? Why?

Cleaning up the web.xml of unnecessary configuration is the first step to take.
[ November 16, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
the servlet stuff is my system

The jstl stuff (tlds, taglibs etc) is all taken from an example i found on the internet, the exmple worked, until i integrated it with the servlet stuff, that's when I got this problem.

I'll look at tidying it up thogh
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61106
    
  66

Originally posted by Keith Seller:
I'll look at tidying it up thogh

Good idea. Gumming up the works with goo from a poorly written online example rarely adds value.
Kevin P Smith
Ranch Hand

Joined: Feb 18, 2005
Posts: 362
Now getting a:

javax.servlet.ServletException: javax.servlet.ServletException: WEB2651: Exceeded maximum depth for nested request dispatches: 20

When running in Sun Java WebApp9.0, or the original error in Tomcat 6.0

It only sems to be an issue when I set the ROOT to '/', here are some snippets to my code (I think it must be something to do with the
'<c:import var="page_xml" url="/WEB-INF/xml/index_menu.xml" />'

because it was working from context root '/' before I added the taglib stuff.



Basically all it's doing is at startup, running the servlet-mapping for INDEX '/' in the
PageLoader Servlet it gets the initParam (JSP URL) and forwards it on, the JSP then shecks for a timestamp, if one doesn;t exists the it knows the user has tried to manually enter the JSP name and redirects them to pagenotfound.jsp.

This worked fine until I added the taglib stuff.
[ November 16, 2007: Message edited by: Keith Seller ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL & Servlet-mappings in web.xml