Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2005

Tip: Looking for answers? Try searching our database.

Struts link problem

Thread view: 
TDOR - 03 Jul 2005 15:14 GMT
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 - 03 Jul 2005 16:55 GMT
>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.

Signature

Wendy Smoak

Kamal Chandana - 04 Jul 2005 09:37 GMT
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.