Det er mit jsp siden.....
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"><%@ taglib uri = "/WEB-INF/debugdata.tld" prefix="debug"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>EC Power A/S Debug Info data</title>
</head>
<body>
<table border="0" cellpadding="0" width="600" height="10" align="center" cellspacing="1" >
<tr>
<th valign="top" width="15%"> Opkaldstid</th>
<th valign="top" width="55%"> DebugInfo</th>
<th valign="top" width="30%"> AnlaegId</th>
<th valign= "top" width="10%"> Kvittering</th>
</tr>
</table>
<table border="1" cellpadding="0" width="600" height="500" align="center" cellspacing="1" >
<tr>
<td align="center" width="15%"><debug:debuginfo type="OPKDATO"></debug:debuginfo></td>
<td align="center" width="55%"><debug:debuginfo type="DEBUGINFO"></td>
<td align="center" width="30%"><debug:debuginfo type="ANLAEGID"></td>
<td align="center"><input type="Checkbox" name="sms"></td>
<tr>
</table>
</body>
</html>
og det er mit kontroller klass....
package dk.ecpower.tags.kvittering;
import dk.ecpower.kernel.exceptions.WrongInputParameterException;
import dk.ecpower.kernel.debuginfo.Kvittering;
import dk.ecpower.kernel.debuginfo.KvitteringManager;
import java.io.*;
import javax.servlet.ServletException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
import dk.ecpower.tags.ECTag;
import javax.servlet.http.*;
import java.io.IOException;
import java.util.*;
public class DebugInfoServlet extends ECTag{
static final long serialVersionUID = 1L;
private String type = "";
Kvittering kvitt = new Kvittering();
/*Check that the input parameter is the one that is expected*/
public void setType(String type) throws WrongInputParameterException {
if (type != null) {
if ((!type.equals("ID")) && (!type.equals("ANLAEGID")) && (!type.equals("OPKDATO")) && (!type.equals("DEBUGINFO")))
throw new WrongInputParameterException(this.getClass(), type);
} else
throw new WrongInputParameterException(this.getClass(), type);
this.type = type;
}
/*Set the attributes key/value pair*/
protected void handleHttpRequest(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.getSession().setAttribute("id", kvitt );
}
/*Handle the tag file*/
public int doStartTag() throws JspException {
try {
JspWriter out = pageContext.getOut();
if (getRequest().getAttribute("id") != null) {
kvitt = (Kvittering)getRequest().getAttribute("id");
if(type.equals("ID")){
out.print(kvitt.getId());
}else if(type.equals("OPKDATO")){
out.print(kvitt.getOpkdato());
}else if(type.equals("ANLAEGID")){
out.print(kvitt.getAnlaegnr());
}else if (type.equals("DEBUGINFO")){
out.print(kvitt.getdebuginfo());
}
}
else{
Enumeration enum = getRequest().getAttributeNames();
while (enum.hasMoreElements()) {
out.print(enum.nextElement().toString());
}
} //out.print("Hello World....");
return EVAL_PAGE;
}
catch (Exception ex) {
ex.printStackTrace();
}
return EVAL_PAGE;
}
}