I'd recommend going to the Learntechnology site, and reading this:
http://www.learntechnology.net/content/struts/struts_crud.jsp

        -----Original Message----- 
        From: Henry F. Camacho Jr. [mailto:[EMAIL PROTECTED] 
        Sent: Thu 5/24/2007 9:10 PM 
        To: user@struts.apache.org 
        Cc: 
        Subject: CRUD Application - How can I receive url attributes
        
        

        I've been banging my head on this one reading everything I can.  I new
        to struts, and I apologize if this is somehow redundant to this list.
        
        I've got a CRUD application I place various records from a database into
        a table with an edit button.  This edit button has the following format:
        
        http://localhost:8080/Inventory/AdminUserEdit.do?id=1
        
        What I am trying to do is to preload a form with the data associated to
        id=1 in my database.  Since I can not figure out how to access the id=1
        from the form bean context I can not pre-populate the form for display.
        
        Here is my struts-config.  The action in question is /AdminUsersEdit. 
        If I hard code the formbean, it displays data in the form.  Of course I
        would like to get access to that ID value to grab the data from the
        database.
        
        <struts-config>
            <form-beans>
                <form-bean name="logonForm"
        type="com.unpluggedcities.inventory.LogonForm"/>
                <form-bean name="adminUserEditForm"
        type="com.unpluggedcities.inventory.AdminUserEditForm"/>
            </form-beans>
            <action-mappings>
                <action path="/Welcome" forward=".welcome_page"
        roles="owner,engineer,store"/>
                <action path="/WelcomeOwner" forward=".welcome_page"
        roles="owner,engineer,store"/>
                <action path="/WelcomeOwnerStatus" forward=".welcome_page"
        roles="owner,engineer,store"/>
                <action path="/Admin" forward=".admin_page" roles="admin"/>
                <action path="/AdminUsers" forward=".admin_user_page"
        roles="admin"/>
                <action path="/AdminUserEdit" forward=".admin_user_edit_page"
        roles="admin"/>
                <action path="/AdminOwners" forward=".welcome_page" 
roles="admin"/>
            <action path="/Logon" forward=".logon_page" roles="any"/>
            <action path="/Logoff" forward=".logoff_page" roles="any"/>
          
                <action path="/LogonSubmit"
                        type="com.unpluggedcities.inventory.LogonAction"
                        name="logonForm"
                        scope="request"
                        validate="true"
                roles="any"
                        input="/Logon.do">
                         
                        <forward name="success"
        path="/Welcome.do"/>                  
                <forward name="failure" path="/Logon.do"/>                  
                </action>
          
                <action path="/AdminUserEditSubmit"
                        type="com.unpluggedcities.inventory.AdminUserEditAction"
                        name="adminUserEditForm"
                        scope="request"
                        validate="true"
                roles="admin"
                        input="/AdminUserEdit.do">
                         
                        <forward name="success"
        path="/AdminUsers.do"/>                  
                <forward name="failure"
        path="/AdminUserEdit.do"/>                  
                </action>
                          
            </action-mappings>
        
        Thanks so much for any help....
        
        HFC
        
        
        
        
        ---------------------------------------------------------------------
        To unsubscribe, e-mail: [EMAIL PROTECTED]
        For additional commands, e-mail: [EMAIL PROTECTED]
        
        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to