Hi,
I wanted to apply the ideas of the "Html Buttons and Struts - The Right Way" tutorial (http://j2ee-01.lagnada.com/struts/html-buttons.htm) to my struts app, but it does not work at all. Here's the JSP snippet :
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>
...
<c:forEach var="curLink" items="${editForm.links}" varStatus="status">
<html-el:text property="curLink[${status.count}]" styleId="normal"/><br/>
</c:forEach><br/>
<html-el:image property="buttons.addLink" alt="Add Link" src="add.gif"/>
<br/><br/>
<html-el:submit property="buttons.submit.name" styleId="button"/>
<html-el:cancel property="buttons.cancel.name" styleId="button"/>
</html:form>
The Form class has a corresponding getButtons() method which returns a bean that in turn has getSubmit(), getCancel() and getAddLink() methods. These then return beans with accessors for name, x, and y just as described in the tutorial.
When I click on any of these buttons, then I get this exception:
javax.servlet.ServletException: BeanUtils.populate org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254) org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
root cause:
java.lang.IllegalArgumentException: No bean specified org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java:837) org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:934) org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808) org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252) org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
which is caused by the fact that the BeanUtils try to access the property "buttons.addLink.y".
So is this a problem with html-el, or what is my error ?
regards, Tom
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]