How are you building your application? It sounds like you are not using
maven (I highly recommend it so you avoid many problem). Now, a couple
of things about this post:
- The error you are referring, is it an error in Eclipse or during
deployment? Two BIG different things.
- If Eclipse doesn't recognize the struts 2 tag, it's because you have
not included the strut2-*.jar files in the classpath. Please check the
documentation of Eclipse if you are not familiar how to do that. Since
the way URI resolution has changed through out the different JSP
versions, Eclipse will resolve the URI according to the following
heuristic (see link -
http://www.eclipse.org/webtools/jst/components/jsp/designs/taglibindex/taglibindex.html)
Please keep in mind that the fact that it resolves in Eclipse is no
indication that it will resolve during deployment (unless you have a
good development environment that mimics your deployment jars)
- Depending on the container that you are using, you don't need to use
web.xml at all (tld file should be within the jar file and the container
should know where to look for it)
- What jars have you included? At a minimum you shouls have:
struts-core-x.jar, xwork-x.jar, ognl-x.jar, freemarker-x.jar (x refers
to the release, which may not be the same). These releases are easy to
obtain if you use maven. If you don't then, when you download the struts
2 distribution, these should come. If you are learning, just copy *all*
and learn what breaks as you take jar by jar off the lib directory.
- If the textfield doesn't show, there may be many reasons for that to
happen. Have you consider? (i) Not having all jars in the lib directory,
(ii) your struts tag having a "name" attribute mapping to an unknown
property. (iii) Have you looked at the produced HTML? (iv) Have you
checked all logs?
AbelMacAdam wrote:
AbelMacAdam wrote:
Hi,
I'm learning to work with Struts. (FWIW, I use Eclipse Europa, and
Apache/Tomcat). Now I have my first example with a tld-file. First of all,
I noticed the following error in Eclipse on a jsp:
Cannot find the tag library descriptor for /tags/struts-html
The first line of the jsp with the error is:
<%@ taglib uri="/tags/struts-html" prefix="html" %>
My WEB-INF/web.xml contains the following lines:
<taglib>
<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/struts_html.tld</taglib-location>
</taglib>
And the same WEB-INF directory also contains the struts_html.tld file.
So far the background. If I run this example in Tomcat I get a page
without textfields and a submit button. So this example clearly does not
work. Do you know what I need to do to get this example working? Am I
right in assuming I get not textfields/buttons because the tag library
descriptor is not found?
TIA,
Abel
What version of Struts 1 are you using?
None. I actually use 2.0.11.
Easy way to check: unpack the jar and see if the META-INF directory
contains the tld. It could very well be an incorrectly built jar.
Struts.jar contains struts-html.tld
And strangely enough, the next example did not show the error, and was
displayed correctly. I even added Struts to the first example. But it still
does not work. If no one else has an explanation I write it off to earth
rays.
Abel
--
Alberto A. Flores
http://www.linkedin.com/in/aflores
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]