Change Log in app in Struts to XForm

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Change Log in app in Struts to XForm

miguel_tinte
Hi all,

I have installed Tomcat, Struts and Orbeon-Xforms and I am working on changing a simple Struts app which just has two input parameter into an XForm app. It's something like this:

1) First, I load the index.jsp in the web browser:
http://localhost:8080/Login/jsp/index.jsp

The code is something like this:
<form name="loginForm" action="login.do" method="post">
        <br/>
          User Name:
        <center>
        <input type="text" name="user" value=""><br/><br/>
        </center>
            Password:
    <center>
        <input type="password" name="password" ><br/><br/>
        </center>
        <center>
          <input type="Submit" name="Submit"  value="enviar" onclick="validar()"/>
        </center>
        <input type="hidden" name="action" value="login"/>       
</form>

2) When I click on submit, I generate an Struts action which is managed in the model:
public ActionForward LoginAction(ActionMapping mapping,
                                                ActionForm form,
                                                HttpServletRequest request,  
                                                HttpServletResponse response){
           String username = request.getParameter("user");
           String password = request.getParameter("password");
           ....
           return mapping.findForward("welcome");
}

3) Then, the action looks in the struts-config.xml searching the "welcome" path:
<action path="/manage"
            validate="true"
            type="web.actions.ManageAction"
            scope="request">   
            <forward name="welcome"
                         path="/orbeon/xforms-jsp/welcome.jsp"/>         
</action> 

How can I comunicate both jsp's, one in Struts and another in Orbeon XForms?? How can I send data from the Struts model in Java to the XForm jsp ??? Is it posible ???

Thanks in advance