struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Becky Norum <bno...@coe.neu.edu>
Subject Re: Html::textarea loses characters
Date Sun, 02 Mar 2003 19:08:10 GMT
Sakis,

What do your struts-config.xml and web.xml look like?
On first glance, the classes you posted look fine.

web.xml should have:
        <servlet-mapping>
                <servlet-name>YOUR SERVLET NAME</servlet-name>
                <url-pattern>*.do</url-pattern>
        </servlet-mapping>

and struts-config should haev appropriate mappings.

-- 
Becky Norum
Database Administrator
Center for Subsurface Sensing and Imaging Systems (CenSSIS)
Northeastern University
http://www.censsis.neu.edu


On Sun, 2003-03-02 at 12:29, Sakis Chatzinikolaou wrote:
> Hi all,
> 
> I have a problem with html:textarea.
> 
> This is how it goes.
> 
> I have an action Form  with only one property landComments
> package untitled1;
> 
> import org.apache.struts.action.*;
> import javax.servlet.http.*;
> 
> public class Untitled1ActionForm extends ActionForm {
>   private String landComments;
>   public void setLandComments(String landComments) {
>     this.landComments = landComments;
>   }
>   public String getLandComments() {
>     return landComments;
>   }
>   public ActionErrors validate(ActionMapping actionMapping,
> HttpServletRequest httpServletRequest) {
>     return null;
>   }
>   public void reset(ActionMapping actionMapping, HttpServletRequest
> httpServletRequest) {
>   }
> }
> 
> Nothing much.
> 
> I also have this Action which gets the ActionForm and calls a jsp to show
> the string in the textarea
> package untitled1;
> 
> import org.apache.struts.action.*;
> import javax.servlet.http.*;
> 
> import untitled1.Untitled1ActionForm;
> public class Untitled1Action extends Action {
>   public ActionForward perform(ActionMapping actionMapping, ActionForm
> actionForm, HttpServletRequest httpServletRequest, HttpServletResponse
> httpServletResponse) {
>     Untitled1ActionForm form = (Untitled1ActionForm) actionForm;
>     String a = form.getLandComments();
> 
>     System.out.println(a);
>     return new ActionForward("/jsp2.jsp?test=" + a);
>   }
> }
> 
> and last I have a jsp1.jsp and jsp2.jsp
> JSP1
> <%@ page contentType="text/html; charset=iso-8859-7" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
> 
> <html>
> <body>
> <html:form action="/Untitled1Action.do" >
> <html:textarea  name="untitled1ActionForm" property="landComments"
> cols="40" rows="4" >
> </html:textarea>
> <html:submit />
> </html:form>
> </body>
> </html>
> 
> JPS2
> <%@ page contentType="text/html; charset=iso-8859-7" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
> <html>
> <head>
> 
> </head>
> <body>
> <h1>
> <%= request.getParameter("test") %>
> </h1>
> </body>
> </html>
> 
> 
> Now the problem :
> The characters in the textarea display right in greek characters when I
> writein the jsp1
> When I click submit and go to the Action the landComments string has false
> characters and finally I get ???in the jsp2
> 
> I use Struts 1.01, Windows 2000 SP4 and Apache Tomcat 4.1.18
> 
> Could anyone think of something ?
> Thanks in advance
> Sakis
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message