- This topic has 11 replies, 6 voices, and was last updated 18 years, 1 month ago by Riyad Kalla.
-
AuthorPosts
-
k6rksMemberI built the StrutsLoginDemo and found it very well done right up to the time that I ran it and got the following 500 error:
org.apache.jasper.JasperException: This absolute uri (http://jakarta.apache.org/struts/tags-bean) cannot be resolved in either web.xml or the jar files deployed with this application
Other than that I liked the demo very much. It was well thought out and documented. I just wish that it had worked for me. One of the reasons I am trying to use Eclipse and MyEclipse is so that the IDE will use the computer to find some of these problems before they occur.
Riyad KallaMemberrks,
If you added Struts capabilities using the Struts 1.2 libraries, you need to change your taglib URIs to:http://struts.apache.org/tags-bean
and so on for the others.
k6rksMemberThank you for the reply. When I changed the URI’s as you suggested, Eclipse gave me the same error as Tomcat does at runtime — cannot resolve the URI. I prefer getting the error in Eclipse rather than after deploying and trying to run the demo.
I was able to get it to work by changing the URI to one from another project form Steve Holzner’s book, “Eclipse”.
Summary:
MyEclipse creates this which works at IDE time but not at runtime under Tomcat:
<%@ taglib uri=”http://jakarta.apache.org/struts/tags-bean” prefix=”bean” %>Suggested fix fails at IDE time and at runtime:
<%@ taglib uri=”http://struts.apache.org/tags-bean” prefix=”bean” %>Version that works in Eclipse and at runtime:
<%@ taglib uri=”/WEB-INF/struts-bean.tld” prefix=”bean” %>NEW POINT: the demo says “if there is an authorization error during the login attempt, we will redirect the user back to the loginUser.jsp page and display an error message.” I cannot see in the demo where any error message is setup or printed out.
Jesse ClarkMemberI have experienced the same problem. The struts 1.2 taglibs URI format causes the IDE to generate error warnings on the JSP page. falling back to the ‘/WEB-INF/…’ uri works provided the tlds are present in the directory.
Jesse ClarkMemberI experienced this problem after installing MyEclipse and it persisted even after restarting the IDE. However, after I rebooted my machine and recreated the demo project the problem didn’t occur.
I am running Eclipse 3.0.1, MyEclipse 3.8.3, Struts 1.2.4, JDK1.5 on Win2k. All freshly installed. No other Eclipse plug-ins are installed.
Riyad KallaMemberGuys as I mentioned in my post, the taglibs I gave you won’t work unless you are using Struts 1.2, please note that MyEclipse ships with 2 different sets of JSP wizards, ones for Struts 1.1 and ones for Struts 1.2. Qualifying the path to the taglib is incorrect but does work in Tomcat, however it does not work in other application servers. The URI is intended to be used as an identifier (think Hashtable key) where the taglibs are listed in your web.xml file with <taglib> entries OR they are contained within one of the JARs in your classpath in the META-INF folder AND define a default URI (Struts does define a default URI).
If you check the J2EE FAQ, I wrote up a big long description of this.
PaulRSinnemaMemberI’ve created the DemoStruts as described in the Flash Tutorial (b.t.w. The Demo isn’t up to date with the latest version, but you probably new that). I had the same problem as described in this thread.
My question: Can I change to struts 1.2 if have choosen 1.1 in the first place?
Riyad KallaMemberPaul,
You would need to remove Struts complete from your project manually and then re-add it. I think the easiest thing for you to do at this stage is to just create a new web project, be sure to make it Struts 1.2, and then move over the source files and JSPs into the new project.
Jon StrayerMember@support-rkalla wrote:
rks,
If you added Struts capabilities using the Struts 1.2 libraries, you need to change your taglib URIs to:http://struts.apache.org/tags-bean
and so on for the others.
I set up my project as struts 1.2 and that is how the URIs are specified. Still I get this error. Do you have any more ideas?
Riyad KallaMemberjstrayer,
Pay attention to when you are launching the JSP wizard, the “Template” dropdown will ask you if you want to use a Struts 1.1 or Struts 1.2 template, if you added Struts 1.2, you want to use the 1.2 template, otherwise your URIs will be wrong in the generated file.
alliance205Member@k6rks wrote:
Thank you for the reply. When I changed the URI’s as you suggested, Eclipse gave me the same error as Tomcat does at runtime — cannot resolve the URI. I prefer getting the error in Eclipse rather than after deploying and trying to run the demo.
I was able to get it to work by changing the URI to one from another project form Steve Holzner’s book, “Eclipse”.
Summary:
MyEclipse creates this which works at IDE time but not at runtime under Tomcat:
<%@ taglib uri=”http://jakarta.apache.org/struts/tags-bean” prefix=”bean” %>Suggested fix fails at IDE time and at runtime:
<%@ taglib uri=”http://struts.apache.org/tags-bean” prefix=”bean” %>Version that works in Eclipse and at runtime:
<%@ taglib uri=”/WEB-INF/struts-bean.tld” prefix=”bean” %>NEW POINT: the demo says “if there is an authorization error during the login attempt, we will redirect the user back to the loginUser.jsp page and display an error message.” I cannot see in the demo where any error message is setup or printed out.
i also have the same problem.. but none of the things you suggested worked for me.. 🙁
any other ideas?
Riyad KallaMemberalliance,
My guess is that your URIs are actually wrong, if you want to figure out what they really are, you can expand your struts.jar file, look into the META-INF dir and check the <uri> default values in the individual TLD files. -
AuthorPosts