Ummmm, I'm not sure from your message what you are doing. It sounds like you
are forwarding to a page that contains a form and requires some
initialization.

In that case you would use the [parameterName]= to call the unspecified
method.

In your LookupDispatchAction there is an unspecified method that is called
when you do not specify a value for your paramter. So you just need to
specify an unspecified method in your LookupDispatch action that will
contain all the initialization logic calls that are needed. That would allow
you to use the same page for different dispatch methods.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
[EMAIL PROTECTED]
http://www.phase.ws


-----Original Message-----
From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 12:54 PM
To: 'Struts Users Mailing List'
Subject: RE: LookupDispatchAction Question


I would suggest you read up on the usage of the LookupDispatchAction again.
It was not designed to to be used in the way you are trying to use them.

Take a look at this site http://husted.com/struts/index.html. It has some
good suggestions on the correct usage of the action classes that come with
struts.

-----Original Message-----
From: Avexus Incorporated [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 11, 2003 2:46 PM
To: [EMAIL PROTECTED]
Subject: LookupDispatchAction Question



I am new to Struts and am trying to use the LookupDispatchAction class to
display a page for the first time (i.e. the user is being navigated to this
page from another page).

I have everything setup fine in my struts_config.xml and Struts attempts to
display my page, but was giving the following error:

Request[/lookup] does not contain handler parameter named submit

After researching on the archives, I realized that this message is due to
the fact that the user has not yet clicked any of the "submit" button on
this page (the page hasn't even been displayed yet). The suggestion on the
archive is to implement something similar to the following in the Action
class which extends LookupDispatchAction:

 public ActionForward execute(ActionMapping actionMapping,
         ActionForm actionForm,
         HttpServletRequest httpServletRequest,
         HttpServletResponse httpServletResponse)
   throws Exception
 {
  if (httpServletRequest.getParameter(actionMapping.getParameter()) == null)
  {
   return defaultMethod();
  }
  else
  {
   return super.execute(actionMapping, actionForm, httpServletRequest,
         httpServletResponse);
  }
 }


My question is what do I return from "defaultMethod"? I have to return an
ActionForward but I don't want to forward the user anywhere -- I want to
display the page. How do I do this? I guess I could have 2 pages and 2
actions -- one to display the page initially and one to process the page
upon "submit" -- but that is ugly and I hope not the only solution.





---------------------------------
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to