portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cabio, Michelle (Michelle)" <ca...@avaya.com>
Subject WML problems...
Date Mon, 03 Jun 2002 20:17:35 GMT

I'm trying to simply print out a txt msg to a WAP device on the Open wave simulator...

My portlet looks like this....and it gives the following error after login...

No translator for content-type: text/html
sometimes it gives 
Translation failed for content-type: text/vnd.wap.wml

Any pointers on how to fix this problem??

package com.avaya.portlet;

import java.io.*;
import java.util.*;
import java.rmi.*;

import javax.servlet.*;
import javax.ejb.*;
import javax.naming.*;
import javax.jms.*;

import org.apache.jetspeed.portal.portlets.AbstractPortlet;
import org.apache.turbine.util.RunData;
import org.apache.turbine.om.security.User;
import org.apache.ecs.*;
import org.apache.jetspeed.capability.*;
import org.apache.jetspeed.util.MimeType;
import org.apache.jetspeed.util.servlet.EcsServletElement;
import org.apache.log4j.Category;
import org.apache.log4j.PropertyConfigurator;
import org.apache.jetspeed.services.*;
import org.apache.jetspeed.portal.*;

import org.xml.sax.SAXException;

public class RuleManagerPortlet extends AbstractPortlet 
    public RuleManagerPortlet()
    public ConcreteElement getContent(RunData aRunData)

        String filePath = getPortletConfig().getInitParameter("filePath");
        ElementContainer base = new ElementContainer();

        CapabilityMap cap = CapabilityMapFactory.getCapabilityMap(aRunData);
            if (cap.getPreferredType().equals(MimeType.WML)) {

                String text = new StringBuffer()
               .append("<?xml version='1.0'?>")
               .append("<!DOCTYPE wml PUBLIC '-//WAPFORUM//DTD WML 1.1//EN' 'http://www.wapforum.org/DTD/wml_1.1.xml'>")
               .append("<card id='card1' title='Card 1'>")
               .append("<p>HELLO! CAN U SEE ME?</p>")
                base.addElement(new StringElement(text));
        }catch (Exception e) {



    }//end of getContent   

    public boolean supportsType(MimeType aMimeType){

        return(MimeType.HTML.equals(aMimeType) || MimeType.WML.equals(aMimeType));


}//end of RuleManagerPortlet

To unsubscribe, e-mail:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>

View raw message