Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Struts link problem (http://www.velocityreviews.com/forums/t144610-struts-link-problem.html)

TDOR 07-03-2005 02:14 PM

Struts link problem
 
I have a welcome.jsp and a projectproperties.jsp.
When i press a html link on welcome.jsp to href="projectproperties.do"
im sent
to back welcome.jsp again!? This is from the struts-config:

....
<form-beans>
<form-bean name="ProjectPropertiesForm"
type="myself.ProjectPropertiesForm"/>
</form-beans>
....
<action-mappings>
<action path="/welcome" forward="/Welcome.jsp"/>
<action name="ProjectPropertiesForm" path="/projectproperties"
input="ProjectProperties.jsp" type="myself.ProjectPropertiesAction"
scope="request" validate="true">
<forward name="success" path="/welcome.do"/>
<forward name="failure" path="/ProjectProperties.jsp"/>
</action>
....

I have built it based on the struts-blank.war sample (struts 1.2.7).
What am i doing wrong?

Wendy Smoak 07-03-2005 03:55 PM

Re: Struts link problem
 
"TDOR" <wmsopou@gmail.com> wrote:
>I have a welcome.jsp and a projectproperties.jsp.
> When i press a html link on welcome.jsp to href="projectproperties.do"
> im sent to back welcome.jsp again!?


Let's see something from ProjectPropertiesAction. In particular, I bet
you're calling
mapping.findForward( "success" );
when you mean
mapping.getInputForward();
which would send you to the ProjectProperties.jsp

For some reason you've defined "success" within the ProjectProperties
ActionMapping to go back to welcome:
> <forward name="success" path="/welcome.do"/>


Probably success should go to [something like] ProjectPropertiesSuccess.jsp
which will have a message saying whatever the user did, worked okay.

--
Wendy Smoak



Kamal Chandana 07-04-2005 08:37 AM

Re: Struts link problem
 
The "success" of the /projectproperties action is set to welcome.jsp
page.
Check your myself.ProjectPropertiesAction:
If you have code like
mapping.findForward("success") for the success then you have made a
mistake in struts-config. Change the struts-config file as,
<forward name="failure" path="/welcome.do"/>
<forward name="success" path="/ProjectProperties.jsp"/>

You will understand the error.

If not, paste the code in Action class here.



All times are GMT. The time now is 09:46 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.