Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

where can I download struts tld files from

 
ken bonzo
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
ken bonzo
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
ken bonzo
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See question 12 of our FAQ.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic