facebook

Problem with StrutsLoginDemo

  1. MyEclipse Archived
  2.  > 
  3. Documentation
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #221068 Reply

    k6rks
    Member

    I 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.

    rks@rks.org

    #221159 Reply

    Riyad Kalla
    Member

    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.

    #221229 Reply

    k6rks
    Member

    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&#8221; prefix=”bean” %>

    Suggested fix fails at IDE time and at runtime:
    <%@ taglib uri=”http://struts.apache.org/tags-bean&#8221; 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.

    #223163 Reply

    Jesse Clark
    Member

    I 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.

    #223164 Reply

    Jesse Clark
    Member

    I 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.

    #223165 Reply

    Riyad Kalla
    Member

    Guys 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.

    #241364 Reply

    PaulRSinnema
    Member

    I’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?

    #241371 Reply

    Riyad Kalla
    Member

    Paul,
    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.

    #250836 Reply

    Jon Strayer
    Member

    @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?

    #250856 Reply

    Riyad Kalla
    Member

    jstrayer,
    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.

    #259526 Reply

    alliance205
    Member

    @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&#8221; prefix=”bean” %>

    Suggested fix fails at IDE time and at runtime:
    <%@ taglib uri=”http://struts.apache.org/tags-bean&#8221; 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?

    #259555 Reply

    Riyad Kalla
    Member

    alliance,
    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.

Viewing 12 posts - 1 through 12 (of 12 total)
Reply To: Problem with StrutsLoginDemo

You must be logged in to post in the forum log in