You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by PC Leung <pc...@gmail.com> on 2005/12/30 15:50:25 UTC

why Input form is skipped

I just want the control passing to a form with
a dropdown box so that user can click.

The form does not have a chance to display
and it is skipped to the subsequent form.

Why is it so?

The following is the action class associated
with the form being skipped.

Thanks


public final class SelectUserAction extends Action {

  public ActionForward execute (ActionMapping mapping,
	ActionForm form,
	HttpServletRequest request,
	HttpServletResponse response)
	throws Exception {			
		
  UserProfileService service = new UserProfileService();
  Collection userList = service.getUserProfileList(null);
  HttpSession session = request.getSession();
  session.setAttribute( "userList", userList );

  return mapping.findForward("success");

  }	


	<action path="/selectUser"
		input="user.selectUser"
		name="userForm"
		scope="request"
		validate="false"
		type="com.user.struts.action.SelectUserAction">
		<forward name="success" path="/setupAssignUserSystem.do" />		
		<forward name="cancel" path="/userProfileMaint.do"/>			
	</action>

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


Re: why Input form is skipped

Posted by Michael Jouravlev <jm...@gmail.com>.
"input" form is not an input form, it is an error form. Bad naming.

Michael.

On 1/4/06, PC Leung <pc...@gmail.com> wrote:
> If the user clicks the submit button, then configuration
> tells where "success" URL to go.
> But user has no chance to click the submit button,
> because the form does not display at all.
> And it is forwarded to "success" URL automatically!
>
>
>
> On 1/1/06, Laurie Harper <la...@holoweb.net> wrote:
> > What do you mean by 'the form is skipped'? The configuration has one
> > action mapping with two logical outcomes, each of which is mapped to
> > different actions. The code for that action always returns the outcome
> > 'success'. Thus, whenever your request /selectUser.do, Struts should
> > forward to the /setupAssignUserSystem.do action, and what the browser
> > displays will depend on what that action mapping says.
> >
> > We'd need to know what you're actually requesting when you want to
> > display your form (the URL you request) and to see all the relevant
> > action mappings from your config to help further.
> >
> > L.
> >
> > PC Leung wrote:
> > > I just want the control passing to a form with
> > > a dropdown box so that user can click.
> > >
> > > The form does not have a chance to display
> > > and it is skipped to the subsequent form.
> > >
> > > Why is it so?
> > >
> > > The following is the action class associated
> > > with the form being skipped.
> > >
> > > Thanks
> > >
> > >
> > > public final class SelectUserAction extends Action {
> > >
> > >   public ActionForward execute (ActionMapping mapping,
> > >       ActionForm form,
> > >       HttpServletRequest request,
> > >       HttpServletResponse response)
> > >       throws Exception {
> > >
> > >   UserProfileService service = new UserProfileService();
> > >   Collection userList = service.getUserProfileList(null);
> > >   HttpSession session = request.getSession();
> > >   session.setAttribute( "userList", userList );
> > >
> > >   return mapping.findForward("success");
> > >
> > >   }
> > >
> > >
> > >       <action path="/selectUser"
> > >               input="user.selectUser"
> > >               name="userForm"
> > >               scope="request"
> > >               validate="false"
> > >               type="com.user.struts.action.SelectUserAction">
> > >               <forward name="success" path="/setupAssignUserSystem.do" />
> > >               <forward name="cancel" path="/userProfileMaint.do"/>
> > >       </action>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: why Input form is skipped

Posted by PC Leung <pc...@gmail.com>.
If the user clicks the submit button, then configuration
tells where "success" URL to go.
But user has no chance to click the submit button,
because the form does not display at all.
And it is forwarded to "success" URL automatically!



On 1/1/06, Laurie Harper <la...@holoweb.net> wrote:
> What do you mean by 'the form is skipped'? The configuration has one
> action mapping with two logical outcomes, each of which is mapped to
> different actions. The code for that action always returns the outcome
> 'success'. Thus, whenever your request /selectUser.do, Struts should
> forward to the /setupAssignUserSystem.do action, and what the browser
> displays will depend on what that action mapping says.
>
> We'd need to know what you're actually requesting when you want to
> display your form (the URL you request) and to see all the relevant
> action mappings from your config to help further.
>
> L.
>
> PC Leung wrote:
> > I just want the control passing to a form with
> > a dropdown box so that user can click.
> >
> > The form does not have a chance to display
> > and it is skipped to the subsequent form.
> >
> > Why is it so?
> >
> > The following is the action class associated
> > with the form being skipped.
> >
> > Thanks
> >
> >
> > public final class SelectUserAction extends Action {
> >
> >   public ActionForward execute (ActionMapping mapping,
> >       ActionForm form,
> >       HttpServletRequest request,
> >       HttpServletResponse response)
> >       throws Exception {
> >
> >   UserProfileService service = new UserProfileService();
> >   Collection userList = service.getUserProfileList(null);
> >   HttpSession session = request.getSession();
> >   session.setAttribute( "userList", userList );
> >
> >   return mapping.findForward("success");
> >
> >   }
> >
> >
> >       <action path="/selectUser"
> >               input="user.selectUser"
> >               name="userForm"
> >               scope="request"
> >               validate="false"
> >               type="com.user.struts.action.SelectUserAction">
> >               <forward name="success" path="/setupAssignUserSystem.do" />
> >               <forward name="cancel" path="/userProfileMaint.do"/>
> >       </action>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: why Input form is skipped

Posted by Laurie Harper <la...@holoweb.net>.
What do you mean by 'the form is skipped'? The configuration has one 
action mapping with two logical outcomes, each of which is mapped to 
different actions. The code for that action always returns the outcome 
'success'. Thus, whenever your request /selectUser.do, Struts should 
forward to the /setupAssignUserSystem.do action, and what the browser 
displays will depend on what that action mapping says.

We'd need to know what you're actually requesting when you want to 
display your form (the URL you request) and to see all the relevant 
action mappings from your config to help further.

L.

PC Leung wrote:
> I just want the control passing to a form with
> a dropdown box so that user can click.
> 
> The form does not have a chance to display
> and it is skipped to the subsequent form.
> 
> Why is it so?
> 
> The following is the action class associated
> with the form being skipped.
> 
> Thanks
> 
> 
> public final class SelectUserAction extends Action {
> 
>   public ActionForward execute (ActionMapping mapping,
> 	ActionForm form,
> 	HttpServletRequest request,
> 	HttpServletResponse response)
> 	throws Exception {			
> 		
>   UserProfileService service = new UserProfileService();
>   Collection userList = service.getUserProfileList(null);
>   HttpSession session = request.getSession();
>   session.setAttribute( "userList", userList );
> 
>   return mapping.findForward("success");
> 
>   }	
> 
> 
> 	<action path="/selectUser"
> 		input="user.selectUser"
> 		name="userForm"
> 		scope="request"
> 		validate="false"
> 		type="com.user.struts.action.SelectUserAction">
> 		<forward name="success" path="/setupAssignUserSystem.do" />		
> 		<forward name="cancel" path="/userProfileMaint.do"/>			
> 	</action>


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