You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Geoff Seel <ge...@foto.co.uk> on 2002/09/23 20:01:42 UTC
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: info@foto.co.uk
Surrey KT5 8PD WWW: www.foto.co.uk
United Kingdom
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Redirected to index.jsp unexpectedly
Posted by Zahid Rahman <za...@btconnect.com>.
Here is a suggestion!
Download chapter 21 of JSP PRO second edition from www.wrox.com
It shows a complete struts application for a Shopping cart.
It has login form, logout form etc.
----- Original Message -----
From: "Geoff Seel" <ge...@foto.co.uk>
To: <st...@jakarta.apache.org>
Sent: Monday, September 23, 2002 7:01 PM
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: info@foto.co.uk
> Surrey KT5 8PD WWW: www.foto.co.uk
> United Kingdom
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>