struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sakis Chatzinikolaou" <sh...@upatras.gr>
Subject Re: Html::textarea loses characters
Date Sun, 02 Mar 2003 19:12:38 GMT
Hi  Becky
The web.xml is this
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
      <param-name>debug</param-name>
      <param-value>2</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>
  <taglib>
    <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
  </taglib>
  <taglib>
    <taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-template.tld</taglib-location>
  </taglib>
</web-app>

and the struts.xml is this

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<struts-config>
  <form-beans>
    <form-bean name="untitled1ActionForm"
type="untitled1.Untitled1ActionForm" />
  </form-beans>
  <action-mappings>
    <action name="untitled1ActionForm" type="untitled1.Untitled1Action"
scope="session" path="/Untitled1Action" />
  </action-mappings>
</struts-config>

Thanks for the concern

----- Original Message -----
From: "Becky Norum" <bnorum@coe.neu.edu>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Sunday, March 02, 2003 9:08 PM
Subject: Re: Html::textarea loses characters


> 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
>


---------------------------------------------------------------------
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