Results 1 to 7 of 7
- 03-22-2011, 07:19 PM #1
Member
- Join Date
- Mar 2011
- Location
- chennai
- Posts
- 55
- Rep Power
- 0
when i implement forward it shows the error in server
when i implement forward it shows the error in server.
with out forward it work fine but when i implemented the forward to another it shows errors in server.
SEVERE: Parse Error at line 122 column 23: The content of element type "action-mappings" must match
"(action)*".
org.xml.sax.SAXParseException: The content of element type "action-mappings" must match "(action)*".
this is my struts file:
import org.apache.struts.action.*;
import javax.servlet.http.*;
public class NewStruts extends Action{
public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response){
ActionForward af=null;
System.out.println("action form displayed");
af=mapping.findForward("hello");
return af;
}
}
this is my action-mappings tab in struts-config.xml:
<action-mappings>
<!-- Default "Welcome" action -->
<!-- Forwards to Welcome.jsp -->
<action
path="/Welcome"
forward="/pages/Welcome.jsp"/>
<!-- sample input and input submit actions
<action
path="/Input"
type="org.apache.struts.actions.ForwardAction"
parameter="/pages/Input.jsp"/>
<action
path="/InputSubmit"
type="app.InputAction"
name="inputForm"
scope="request"
validate="true"
input="/pages/Input.jsp"/>
<action
path="/edit*"
type="app.Edit{1}Action"
name="inputForm"
scope="request"
validate="true"
input="/pages/Edit{1}.jsp"/>
end samples -->
<action type="NewStruts" path="/one"/>
<forward name="hello" path="/index.jsp"/>
</action-mappings>
i hope any one can help me
- 03-23-2011, 08:27 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,448
- Rep Power
- 16
Parse Error at line 122 column 23
Which line is 122 in the xml?
ETA: Is "forward" a valid child element of attribute-mappings?
I think not.
- 03-23-2011, 09:38 AM #3
Member
- Join Date
- Mar 2011
- Location
- chennai
- Posts
- 55
- Rep Power
- 0
not attribute-mappings action-mappings.
it is write the forward is correct child tag.
- 03-23-2011, 10:36 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,448
- Rep Power
- 16
No it's not (and sorry, I meant action-mappings).
The only child element of that is an action.
<action> has <forward> as a child element.
- 03-23-2011, 02:53 PM #5
Member
- Join Date
- Mar 2011
- Location
- chennai
- Posts
- 55
- Rep Power
- 0
thanks for you help.
- 03-23-2011, 02:58 PM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,448
- Rep Power
- 16
Has Struts stopped complaining?
- 03-25-2011, 04:17 AM #7
Member
- Join Date
- Mar 2011
- Location
- chennai
- Posts
- 55
- Rep Power
- 0
Similar Threads
-
Custom exception exits program, while NumberFormatException only shows error
By DerekRaimann in forum New To JavaReplies: 6Last Post: 12-09-2010, 08:44 AM -
forward request url from server side
By ragavendran in forum Java ServletReplies: 1Last Post: 11-30-2010, 03:28 PM -
OutOfMemory error occurs, but profiler shows half the heap is free?!?!
By v.svetoslavov in forum Advanced JavaReplies: 7Last Post: 01-30-2009, 06:40 AM -
<jsp:include> Vs <%@include> Vs <jsp:forward> Vs RequestDispatcher .forward/includeVs
By freddieMaize in forum Java ServletReplies: 5Last Post: 07-29-2008, 02:13 PM -
API to Implement Server SSH in JAVA
By Jack in forum Advanced JavaReplies: 2Last Post: 07-02-2007, 01:52 AM


LinkBack URL
About LinkBacks
Reply With Quote
D
Bookmarks