Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

realtion betweeen view and struts-config

 
Rauhl Roy
Ranch Hand
Posts: 401
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

are we supposed to mention the same name in the struts-config 's action path and view path in order to struts framework to get recognised.

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

this is my view
<html>
<head>
<title>Sample Struts Application</title>
</head>
<body>
<html:form action="Name" name="nameForm" type="example.NameForm">
<table width="80%" border="0">
<tr>
<td>Name:</td>
<td><html:text property="name" /></td>
</tr>
<tr>
<td><html:submit /></td>
</tr>
</table>
</html:form>
</body>
</html>


and this is my struts-config s action map

<action path="/Name" type="example.NameAction" name="nameForm" input="/index.jsp">
<forward name="success" path="/displayname.jsp"/>
<forward name="failure" path="/index.jsp"/>
</action>
---------------

my doubt is both boled things are to be same or not.

please tell me

rahul
 
Ajit Kanada
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you are right.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic