Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Struts link problem

Reply
Thread Tools

Struts link problem

 
 
TDOR
Guest
Posts: n/a
 
      07-03-2005
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?
 
Reply With Quote
 
 
 
 
Wendy Smoak
Guest
Posts: n/a
 
      07-03-2005
"TDOR" <> 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


 
Reply With Quote
 
 
 
 
Kamal Chandana
Guest
Posts: n/a
 
      07-04-2005
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Link Link Link =?Utf-8?B?REw=?= Windows 64bit 0 05-17-2005 12:15 PM
Re: Link Link Link DANGER WILL ROBINSON!!! Kevin Spencer ASP .Net 0 05-17-2005 10:41 AM
Is it safe to point to Internet for locating struts DTD files in struts TLDs and XML files? Katie Wright Java 8 01-07-2005 03:37 PM
Tomcat 5.028 Struts problem - struts-config.xml does not start with a "/" character Aleksandar Matijaca Java 2 09-19-2004 03:52 PM
Struts Installation - missing struts.tld??? Jason Us Java 0 10-03-2003 11:36 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57