This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes where can I download struts tld files from Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "where can I download struts tld files from" Watch "where can I download struts tld files from" New topic
Author

where can I download struts tld files from

ken bonzo
Greenhorn

Joined: Oct 11, 2006
Posts: 11
Hi

I am looking for struts tld files.
I could not find the files with the explicit extension "tld"
Could you please let me know about the site where I can get them from.

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60788
    
  65

I highly suspect that the tld files are in the Struts jar files, where the container will easily find them. Why do you need the separate tld files?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
ken bonzo
Greenhorn

Joined: Oct 11, 2006
Posts: 11
Thanks!

I am following a tutorial which asked to put the *.tld files in the WEB-INF directory. in this case which jar file should I put in the WEB-INF directory

Thanks!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60788
    
  65

A Struts tutorial? Or a general tutorial on tag libraries?

If it's a Struts tutorial, then I would have serious doubts as to its credibility, but I will let the more Struts-savvy members make that judgement. In modern web applications, it is never necessary to extract the tld files from the jar files and configure them "by hand".
[ July 26, 2008: Message edited by: Bear Bibeault ]
ken bonzo
Greenhorn

Joined: Oct 11, 2006
Posts: 11
Do you mean that the tld files are included in the jar files within the lib directory?

If in a jsp file I refer to a tld file this way : "<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>" :
- Should not I put the struts-logic.tld file under the WEB-INF directory?
- If the tld files are included within the jar files (under the lib directory), How Should I refer them from the jsp file ?

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60788
    
  65

Firstly, which version of Struts are you trying to set up?

I'm going to let someone more knowledgeable regarding Struts take over at this point, as early versions may have been more primitive.

But generally, in modern web apps you refer to TLDs through their published URIs, not their location on disk.

Again, I'll let a Struts expert comment on the specific version of Struts that you are using. What do the setup instructions in the Struts documentation say to do?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The tutorial you're following is for older versions of Struts. Version 1.2.9 and below require TLD files in the WEB-INF directory, but any version later than 1.2.9 (the current one is 1.3.8) has the TLD files contained in the struts-taglib-1.3.8.jar file that comes with the download.

Your tutorial will no doubt give you incorrect taglib definitions for the JSP. Below are the correct ones:


Merrill
Consultant, Sima Solutions
ken bonzo
Greenhorn

Joined: Oct 11, 2006
Posts: 11
Thanks

I am using struts 1.3.8 as you suggested

When I run the following form.jsp :

<%@ page language="java"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<html:html>
<head>
<title>Struts Example</title>
</head>
<body bgcolor="pink">
<h1>Struts tutorial</h1>
<hr>
<html:form action="WebClient.jsp">
<p>Enter Text value
<html:text property="firstname"/>
<html:submit property="method" value="Submit"/>
</p>
</html:form>
</body>
</html:html>

I am getting the following error :


org.apache.jasper.JasperException: java.lang.NullPointerException: Module 'null' not found.
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:521)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:415)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

root cause

java.lang.NullPointerException: Module 'null' not found.
org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:755)
org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:735)
org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:796)
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:467)
org.apache.jsp.form_jsp._jspx_meth_html_005fform_005f0(form_jsp.java:130)
org.apache.jsp.form_jsp._jspx_meth_html_005fhtml_005f0(form_jsp.java:103)
org.apache.jsp.form_jsp._jspService(form_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

note The full stack trace of the root cause is available in the JBossWeb/2.0.1.GA logs.
JBossWeb/2.0.1.GA

Any idea on how to fix this issue
Thanks!
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
See question 12 of our FAQ.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: where can I download struts tld files from
 
Similar Threads
Error Loading jsp file - Unable to initialize TldLocationsCache: null
Struts
want to know about struts api and tld files
From where do we get .tld files
tlds