ok
got it to work...
But here is the catch.....
I got it to work with struts.jar details of which are ...
Manifest-Version: 1.0
Extension-Name: Struts Framework
Specification-Title: Struts Framework
Specification-Vendor: Apache Software Foundation
Specification-Version: 1.1
Implementation-Title: Struts Framework
Implementation-Vendor: Apache Software Foundation
Implementation-Vendor-Id: org.apache
Implementation-Version: 1.1
Class-Path: commons-beanutils.jar
Class-Path: commons-collections.jar
Class-Path: commons-dbcp.jar
Class-Path: commons-digester.jar
Class-Path: commons-logging.jar
Class-Path: commons-pool.jar
Class-Path: commons-services.jar
Class-Path: commons-validator.jar
Class-Path: jakarta-oro.jar
[got a warning duplicates I guess because of classpath in manifest]
However if I use struts.jar from struts-1.2.7 I get an error saying
SEVERE: ServletException in '/layouts/classicLayout.jsp': ServletException in '/
tiles/body.jsp': /tiles/body.jsp(14,3) Unable to find setter method for attribute: name
javax.servlet.ServletException: ServletException in '/tiles/body.jsp': /tiles/bo
dy.jsp(14,3) Unable to find setter method for attribute: name
I do have the setter method, I am attaching the form and action files.
Should I just use the older version and be happy ( as it could be a bug in ther 1.2.7) or is there a remedy. Thanks for all the support.
bib
Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
package example; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping;
public class NameAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String target = new String("success"); String name = null; if (form != null) { // Use the NameForm to get the request parameters NameForm nameForm = (NameForm) form; name = nameForm.getName(); } // if no mane supplied Set the target to failure if (name == null) { target = new String("failure"); } else { request.setAttribute("NAME", name); } return (mapping.findForward(target)); } }
package example; //import statements import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; public class NameForm extends ActionForm { private String name = null; public String getName() { return (name); } public void setName(String name) { this.name = name; } public void reset(ActionMapping mapping, HttpServletRequest request) { this.name = null; } }
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles Configuration//EN" "http://jakarta.apache.org/struts/dtds/tiles-config.dtd"> <!-- Definitions for Tiles documentation --> <tiles-definitions> <!-- ======================================================= --> <!-- Master definition --> <!-- ======================================================= --> <!-- Main page layout used as a root for other pages defintion. --> <definition name="site.mainLayout" path="/layouts/classicLayout.jsp"> <put name="title" value="Tiles Blank Site" /> <put name="header" value="/tiles/common/header.jsp" /> <put name="menu" value="site.menu.bar" /> <put name="footer" value="/tiles/common/footer.jsp" /> <put name="body" value="/tiles/body.jsp" /> </definition> <!-- ======================================================= --> <!-- Index page definition --> <!-- ======================================================= --> <!-- This definition inherits from the main definition. It overload the page title, and the body used. Use the same mechanism to define new pages sharing common properties (here header, menu, footer, layout) --> <definition name="site.index.page" extends="site.mainLayout" > <put name="title" value="Tiles Blank Site Index" /> <put name="body" value="/tiles/body.jsp" /> </definition> <!-- ======================================================= --> <!-- Menus definitions --> <!-- ======================================================= --> <!-- Menu bar definition This definition describe a "bar" of menu stacked verticaly. Each menu is describe elsewhere. Add new entry in the list to add new menu. --> <definition name="site.menu.bar" path="/layouts/vboxLayout.jsp" > <putList name="list" > <add value="site.menu.links" /> <add value="site.menu.documentation" /> </putList> </definition> <!-- Menu description A menu has a title and a set of entries rendered as links. Add new entry to add new links in menu. --> <definition name="site.menu.links" path="/layouts/menuNoStruts.jsp" > <put name="title" value="Useful Links" /> <putList name="items" > <item value="Home" link="/index.jsp" classtype="org.apache.struts.tiles.beans.SimpleMenuItem" /> <item value="A Menu Item" link="/templateNoDef.jsp" classtype="org.apache.struts.tiles.beans.SimpleMenuItem" /> </putList> </definition> <!-- Another Menu description A menu has a title and a set of entries rendered as links. Add new entry to add new links in menu. --> <definition name="site.menu.documentation" path="/layouts/menuNoStruts.jsp" > <put name="title" value="Documentation" /> <putList name="items" > <item value="User Guide" link="/index.jsp" classtype="org.apache.struts.tiles.beans.SimpleMenuItem" /> <item value="Tags Index" link="/index.jsp" classtype="org.apache.struts.tiles.beans.SimpleMenuItem" /> <item value="Struts Home" icon="/images/struts-power.gif" link="http://www.apache.org" classtype="org.apache.struts.tiles.beans.SimpleMenuItem" /> </putList> </definition> </tiles-definitions>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]