Los errores son estos:
Código:
C:\workspace\Cartografia\src\prueba>javac ImageColumnDecorator.java ImageColumnDecorator.java:3: package javax.servlet.jsp does not exist import javax.servlet.jsp.PageContext; ^ ImageColumnDecorator.java:4: package org.displaytag.decorator does not exist import org.displaytag.decorator.DisplaytagColumnDecorator; ^ ImageColumnDecorator.java:5: package org.displaytag.exception does not exist import org.displaytag.exception.DecoratorException; ^ ImageColumnDecorator.java:6: package org.displaytag.properties does not exist import org.displaytag.properties.MediaTypeEnum; ^ ImageColumnDecorator.java:11: cannot find symbol symbol: class DisplaytagColumnDecorator public class ImageColumnDecorator implements DisplaytagColumnDecorator { ^ ImageColumnDecorator.java:14: cannot find symbol symbol : class PageContext location: class prueba.ImageColumnDecorator public Object decorate(Object columnValue, PageContext pageContext,Media TypeEnum media) throws DecoratorException { ^ ImageColumnDecorator.java:14: cannot find symbol symbol : class MediaTypeEnum location: class prueba.ImageColumnDecorator public Object decorate(Object columnValue, PageContext pageContext,Media TypeEnum media) throws DecoratorException { ^ ImageColumnDecorator.java:14: cannot find symbol symbol : class DecoratorException location: class prueba.ImageColumnDecorator public Object decorate(Object columnValue, PageContext pageContext,Media TypeEnum media) throws DecoratorException { ^ 8 errors C:\workspace\Cartografia\src\prueba>
La clase es:
Código PHP:
package prueba;
import javax.servlet.jsp.PageContext;
import org.displaytag.decorator.DisplaytagColumnDecorator;
import org.displaytag.exception.DecoratorException;
import org.displaytag.properties.MediaTypeEnum;
public class ImageColumnDecorator implements DisplaytagColumnDecorator {
public Object decorate(Object columnValue, PageContext pageContext,MediaTypeEnum media) throws DecoratorException {
String imagePath = (String) columnValue;
StringBuffer sb = new StringBuffer();
sb.append("<img src=\"" + imagePath + "\">");
return sb.toString();
}
}