You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rafael Muneton <ra...@hotmail.com> on 2009/12/16 01:58:28 UTC

How to forward....

Hello:

 

I am trying to develop a small application that contains a Login.jsp, in case of failure the controller must redirect to Login.jsp again;   in case of success the controller must redirect to a Java application ,MainMenu.class.

 

I think this is done in struts-config.xml file:

 

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC

"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"

"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">

<!-- This is the Struts configuration file for the Login example application -->

<struts-config>

<!-- ========== Data Source Definitions ================================ -->

<!-- ========== Form Bean Definitions ================================== --> 

<form-beans>

<form-bean name="loginForm" 

type="jhtp5.jsp.LoginForm"/>

</form-beans> 



<!-- ========== Action Mapping Definitions ============================= --> 

<action-mappings> 

<action path="/login"

type="jhtp5.jsp.LoginAction"

name="loginForm"

scope="request"

input="/login.jsp"

validate="true">

<forward name="failure" path="/login.jsp"/>

<forward name="success" path="/MainMenu.class"/>

</action>

</action-mappings>

<!-- ========== Message Resources Definitions ========================== -->

<message-resources null="false"

parameter="ApplicationResources"/>

</struts-config>

 

Is this OK??????

What is the right way to do it????

Any help is welcome.

 

Vangelis
 		 	   		  
_________________________________________________________________
Windows Live: Make it easier for your friends to see what you’re up to on Facebook.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092009

Re: How to forward....

Posted by Paweł Wielgus <po...@gmail.com>.
Hi Rafael,
instead forward name="success" path="/MainMenu.class"
write forward name="success" path="/MainMenu.do".

Best greetingsgus.
,
Paweł Wiel


2009/12/16 Rafael Muneton <ra...@hotmail.com>:
>
> Hello:
>
>
>
> I am trying to develop a small application that contains a Login.jsp, in case of failure the controller must redirect to Login.jsp again;   in case of success the controller must redirect to a Java application ,MainMenu.class.
>
>
>
> I think this is done in struts-config.xml file:
>
>
>
> <?xml version="1.0" encoding="ISO-8859-1" ?>
>
> <!DOCTYPE struts-config PUBLIC
>
> "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
>
> "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
>
> <!-- This is the Struts configuration file for the Login example application -->
>
> <struts-config>
>
> <!-- ========== Data Source Definitions ================================ -->
>
> <!-- ========== Form Bean Definitions ================================== -->
>
> <form-beans>
>
> <form-bean name="loginForm"
>
> type="jhtp5.jsp.LoginForm"/>
>
> </form-beans>
>
>
>
> <!-- ========== Action Mapping Definitions ============================= -->
>
> <action-mappings>
>
> <action path="/login"
>
> type="jhtp5.jsp.LoginAction"
>
> name="loginForm"
>
> scope="request"
>
> input="/login.jsp"
>
> validate="true">
>
> <forward name="failure" path="/login.jsp"/>
>
> <forward name="success" path="/MainMenu.class"/>
>
> </action>
>
> </action-mappings>
>
> <!-- ========== Message Resources Definitions ========================== -->
>
> <message-resources null="false"
>
> parameter="ApplicationResources"/>
>
> </struts-config>
>
>
>
> Is this OK??????
>
> What is the right way to do it????
>
> Any help is welcome.
>
>
>
> Vangelis
>
> _________________________________________________________________
> Windows Live: Make it easier for your friends to see what you’re up to on Facebook.
> http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_2:092009

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