S
spivee
Okay, I'm missing something here... I've looked at a lot of examples
online, but haven't been able to find out what I'm doing wrong here.
I'm trying to take a Vector of HashMap objects and use logic:iterate to
print them to a web page. This is what I have...
Alerts.class..
public class Alerts {
public HashMap alert;
public Alerts() {
alert = null;
}
public Vector <HashMap> getOpenAlerts() {
Vector <HashMap> alerts = new Vector <HashMap> ();
try {
/**
* Populate Hashmap and vector here. I've confirmed
* this is working. Basically, I've created a String,
* String HashMap and added four values to it; id,
* type, value, and message. Then I add that HashMap
* object to the Vector.
*/
}
catch (Exception ex) {}
return alerts;
}
public void setAlert(HashMap <String, String> alert) {
this.alert = alert;
}
public HashMap getAlert() {
return alert;
}
}
My jsp...
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ page language="java" import="java.util.*" %>
<%@ page language="java" import="com.my.package.Alerts" %>
<%
Alerts openAlerts = new Alerts();
Vector alerts = openAlerts.getOpenAlerts();
session.setAttribute("alerts", alerts);
%>
<logic:iterate name="alerts" property="alert" id="alertobj"
type="com.eds.webhosting.registrar.Alerts" scope="session">
<bean:write name="alertobj" property="id" />-
<bean:write name="alertobj" property="type" />-
<bean:write name="alertobj" property="value" />-
<bean:write name="alertobj" property="message" /><br>
</logic:iterate>
The Error I get is... "[ServletException
in:/WEB-INF/pages/forms/manageAlerts.jsp] No getter method for property
alert of bean alerts"
I just haven't been able go get my head around these things. Any ideas?
online, but haven't been able to find out what I'm doing wrong here.
I'm trying to take a Vector of HashMap objects and use logic:iterate to
print them to a web page. This is what I have...
Alerts.class..
public class Alerts {
public HashMap alert;
public Alerts() {
alert = null;
}
public Vector <HashMap> getOpenAlerts() {
Vector <HashMap> alerts = new Vector <HashMap> ();
try {
/**
* Populate Hashmap and vector here. I've confirmed
* this is working. Basically, I've created a String,
* String HashMap and added four values to it; id,
* type, value, and message. Then I add that HashMap
* object to the Vector.
*/
}
catch (Exception ex) {}
return alerts;
}
public void setAlert(HashMap <String, String> alert) {
this.alert = alert;
}
public HashMap getAlert() {
return alert;
}
}
My jsp...
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ page language="java" import="java.util.*" %>
<%@ page language="java" import="com.my.package.Alerts" %>
<%
Alerts openAlerts = new Alerts();
Vector alerts = openAlerts.getOpenAlerts();
session.setAttribute("alerts", alerts);
%>
<logic:iterate name="alerts" property="alert" id="alertobj"
type="com.eds.webhosting.registrar.Alerts" scope="session">
<bean:write name="alertobj" property="id" />-
<bean:write name="alertobj" property="type" />-
<bean:write name="alertobj" property="value" />-
<bean:write name="alertobj" property="message" /><br>
</logic:iterate>
The Error I get is... "[ServletException
in:/WEB-INF/pages/forms/manageAlerts.jsp] No getter method for property
alert of bean alerts"
I just haven't been able go get my head around these things. Any ideas?