struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robbie Anonymous" <robbie_listre...@lycos.com>
Subject RE: Action class defined in action-mappings not being
Date Sun, 29 May 2005 10:52:23 GMT
I fixed the dtd to be struts 1.2 as thats the version of my struts.jar (Struts 1.2.4).
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
              "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
              "http://struts.apache.org/dtds/struts-config_1_2.dtd">
still doesnt work.

I'm using an execute() method and the code (along with method signature) is below

/*
 * AddContactUs.java
 *
 * Created on May 26, 2005, 10:24 AM
 */

package com.devfirm.actions;

import org.apache.struts.action.*;
import javax.servlet.*;
import com.devfirm.services.*;
import com.devfirm.formbeans.*;
/**
 *
 * @author Robbie
 */
public class AddContactUs extends Action{
    
    /** Creates a new instance of AddContactUs */
    public AddContactUs() {
    }
    
    public ActionForward execute(ActionMapping mapping,
                            ActionForm form,
                            ServletRequest request,
                            ServletResponse response)
    throws Exception {
        //Message.showInfo("Contact Us Action is Running");
        ActionForward forward = null;
        ContactUsService service = new ContactUsService();
        try {
            service.add(form);
            return mapping.findForward("success");
        }catch(Exception e) {
            return mapping.findForward("failure");
        }
    }
}

struts-config.xml : 
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
              "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
              "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
    <data-sources>
    </data-sources>

    <form-beans>
        <form-bean  name="contactUs"
                    type="com.devfirm.formbeans.ContactUs">
        </form-bean>
    </form-beans>

    <global-exceptions>
    </global-exceptions>

    <global-forwards>
    </global-forwards>

    <action-mappings>
        <action    
            path="/addContactUs"
            type="com.devfirm.actions.AddContactUs"
            name="contactUs"
            validate="false"
            input="/contactUs.jsp">
            <forward 
                name="failure" 
                path="/contactUs.jsp"/>
            <forward 
                name="success" 
                path="/contactUs.jsp"/>
        </action>
    </action-mappings>

    <message-resources  parameter="ApplicationResources"/>
</struts-config>

ContactUs.java:
*
 * ContactUs.java
 *
 * Created on May 25, 2005, 11:30 PM
 */

package com.devfirm.formbeans;
import org.apache.struts.action.*;
/**
 *
 * @author Robbie
 */
public class ContactUs extends ActionForm {
    
    /** Creates a new instance of ContactUs */
    public ContactUs() {
        //Message.showInfo("Contact Us Instantaniated");
    }

    private String companyName;
    private String contactName;
    private int contactPhone;
    private String contactEmail;
    private String industry;
    private String message;
    private String foundUsVia;
    
    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public int getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(int contactPhone) {
        this.contactPhone = contactPhone;
    }

    public String getContactEmail() {
        return contactEmail;
    }

    public void setContactEmail(String contactEmail) {
        this.contactEmail = contactEmail;
    }

    public String getIndustry() {
        return industry;
    }

    public void setIndustry(String industry) {
        this.industry = industry;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getFoundUsVia() {
        return foundUsVia;
    }

    public void setFoundUsVia(String foundUsVia) {
        this.foundUsVia = foundUsVia;
    }
    
}

----- Original Message -----
From: "David G. Friedman" <humble@ix.netcom.com>
To: "Struts Users Mailing List" <user@struts.apache.org>
Subject: RE: Action class defined in action-mappings not being executed - without 2mb webapp
source
Date: Sun, 29 May 2005 03:15:07 -0400

> 
> Robbie,
> 
> I see you are using Struts v1.1 (your included DTD lists it as such) so are
> you using execute() or perform()?  What is your Action method's signature?
> 
> Regards,
> David
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org


-- 
_______________________________________________
NEW! Lycos Dating Search. The only place to search multiple dating sites at once.
http://datingsearch.lycos.com


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message