Results 1 to 1 of 1

Thread: SMS zimlets and accents

  1. #1
    caio80 is offline Senior Member
    Join Date
    Mar 2007
    Location
    Ferrara, Italy
    Posts
    55
    Rep Power
    8

    Default SMS zimlets and accents

    Hi there, I'm a Zimbra rookie, and I just deployed the SMS zimlet, having bought the IPIPI.com service for SMS sending. My only problem right now is sending accents. For example, don't work. And actually, in Italy we can't live without!

    I checked the SMS.jsp file inside the zimlet zip, but without luck. On my cell phone i receive just "A?" for each stressed letter. I think this relates to the encoding Zimbra uses, but other than this, I have no clue...

    Any idea? Thanks in advance

    caio80



    ADDENDUM


    Looking around on the net, i found out that with a cute String constructor (see code below) I could resolv my accents too.

    But looks like Zimbra doesnt' care about my import java.lang.* statement at the top of the page. It can't resolv my String constructor (that is: java.lang.String(request.getParameter("body").getB ytes("ISO-8859-1"),"UTF-8");
    String body = request.getParameter("body");

    and yes, I tried even without the prefixed java.lang.[...]...

    Any idea?

    Error Message:

    org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 5 in the jsp file: /zimlet/com_zimbra_sms/sms.jsp Generated servlet error: java.lang cannot be resolved to a type An error occurred at line: 5 in the jsp file: /zimlet/com_zimbra_sms/sms.jsp Generated servlet error: Duplicate local variable body org.apache.jasper.compiler.DefaultErrorHandler.jav acError(DefaultErrorHandler.java:84) org.apache.jasper.compiler.ErrorDispatcher.javacEr ror(ErrorDispatcher.java:328) org.apache.jasper.compiler.JDTCompiler.generateCla ss(JDTCompiler.java:409) org.apache.jasper.compiler.Compiler.compile(Compil er.java:297) org.apache.jasper.compiler.Compiler.compile(Compil er.java:276) org.apache.jasper.compiler.Compiler.compile(Compil er.java:264) org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:563) org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:303) org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:264) javax.servlet.http.HttpS



    File sms.jsp:

    <%@ page contentType="text/html; charset=UTF-8" language="java" import="javax.mail.*,javax.mail.internet.*,java.ut il.*,java.lang.*" %>
    <%@ taglib prefix="z" uri="/WEB-INF/zimbra.tld" %>
    <z:zimletconfig var="config" action="list" zimlet="com_zimbra_sms"/>
    <jsp:directive.page import="java.lang.*"/>
    <%
    // Get account info for http://www.ipipi.com
    Map zConfig = (Map)request.getAttribute("config");
    String username = (String)((Map)zConfig.get("global")).get("smsusern ame");
    String password = (String)((Map)zConfig.get("global")).get("smspassw ord");
    String from = (String)((Map)zConfig.get("global")).get("smsfrom" );

    String subject = "SMS from Zimbra";
    String smtphost = "ipipi.com";
    String phone_num = request.getParameter("to");
    String to;
    String body = java.lang.String(request.getParameter("body").getB ytes("ISO-8859-1"),"UTF-8");
    String body = request.getParameter("body");
    String bodyreq = body;

    [...]




    If I remove the java.lang (should be ok anyways, having imported with java.lang.*) it gives me:

    Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 5 in the jsp file: /zimlet/com_zimbra_sms/sms.jsp Generated servlet error: The method String(byte[]) is undefined for the type sms_jsp org.apache.jasper.compiler.DefaultErrorHandler.jav acError(DefaultErrorHandler.java:84) org.apache.jasper.compiler.ErrorDispatcher.javacEr ror(ErrorDispatcher.java:328) org.apache.jasper.compiler.JDTCompiler.generateCla ss(JDTCompiler.java:409) org.apache.jasper.compiler.Compiler.compile(Compil er.java:297) org.apache.jasper.compiler.Compiler.compile(Compil er.java:276) org.apache.jasper.compiler.Compiler.compile(Compil er.java:264) org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:563) org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:303) org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet .java:802) com.zimbra.cs.zimlet.ZimletFilter.doFilter(ZimletF ilter.java:155) </pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/5.5.15 logs.


    Any idea? I guess I'm missing something stupid...

    Thanks in advance, and keep up the good work, guys!
    Last edited by caio80; 03-21-2007 at 09:27 AM. Reason: more infos on the matter.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •