First, I'm pretty sure the path in your action attribute in the <html:form> tag needs 
to be prefixed with a '/' :

<html:form action="/TopLevelDone.do">

I'd change that just for a sanity check, though it doesn't appear to be your problem.  
Throw some sys-outs or something into your TopLevelAction in a couple of places (right 
before it returns the ActionForward would be a good one) just to make sure it's not 
barfing on something.  

One possibility:  If you have 'index.jsp' set as your web app.'s exception page in 
your web.xml, and your action is throwing an exception, then you'll end up there.  
Double-check that the (possible) exception isn't getting dumped into Strut's log4j log 
or something like that.


peace,
Joe




> -----Original Message-----
> From: Geoff Seel [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 23, 2002 11:02 AM
> To: [EMAIL PROTECTED]
> Subject: Redirected to index.jsp unexpectedly
> 
> 
> I am trying to evaluate Struts for a client and have tried to build an
> example from the basic struts-blank.war.I am clearly making a stupid
> error but cannot find anything similar in the mailing 
> archives so would
> appreciate help for a newbie.
> 
> My first jsp (TopLevel.jsp) contains the following:
> 
> <html:form action="TopLevelDone.do">
> Menu:      <html:select property="menu">
>              <html:option value="AC">Add Calendar</html:option>
>              <html:option value="AH">Add Holiday</html:option>
>              <html:option value="RC">Remove Calendar</html:option>
>              <html:option value="RH">Remove Holiday</html:option>
>              <html:option value="LC">List Calendars</html:option>
>              <html:option value="LH">List Holidays</html:option>
>              <html:option value="HD">Holiday Dates</html:option>
>            </html:select><br>
>            <html:submit value="Enter"/>
> </html:form>
> 
> My struts-config.xml contains the following
> 
>        <action path="/TopLevelDone" 
>                type="actions.TopLevelAction"
>                name="TopLevelForm"
>                scope="request"
>                input="/TopLevel.jsp">
>          <forward name="addCalendar" path="/AddCalendar.jsp"/>
>          <forward name="failure" path="/TopLevel.jsp"/>
>        </action>
> 
> I have a TopLevelAction.class in the actions package that 
> just pulls in
> the value of menu and redirects according to its value.
> 
> When I run the jsp and enter a value I get redirected back to 
> index.jsp
> with '?menu=AC&submit=Enter' appended.
> If I change the action attribute in html:form to rubbish it says it
> can't find the action so it must be getting that far. There 
> are no error
> messages in the logs I can access (running it on Sun Reference
> Implementation J2EE 1.3.1).
> -- 
> Geoff Seel                              Voice:  +44 (0)20-8296-0684
> Financial Object Toolkits Ltd.          Mobile: 0797-688-0668
> 54, Berrylands Road,                    Fax:    +44 (0)870-054-7931
> Surbiton,                               e-mail: [EMAIL PROTECTED]
> Surrey KT5 8PD                          WWW:    www.foto.co.uk 
> United Kingdom
> 
> --
> To unsubscribe, e-mail:   
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


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

Reply via email to