Hi,

>   The string were cut by %0D%0A characters.  Is my javabean wrong ?

No, these are carriage return line feed between your two lines that are
coming from the text area.

I can't really tell what the problem is, but if I had to guess, I would
say that you're constructing your insert string by concatenating
the strings instead of using a prepared statement by doing something
like:

insertString = "insert into foo values (a,b) values (" + a + "," + b + ")";

instead of using a prepared statement like:

insertString = "insert into foo values (a,b) values (?,?)";

If that's the case, migrating to a prepared statement should solve your
problem.

Hope this  helps,

Dror

On Fri, Nov 15, 2002 at 12:32:13AM -0700, Polgár István wrote:
> Hi everybody,
>
> I have a problem with using response.sendRedirect JSP command.
> I have written an jsp application. The main jsp page ( sz.jsp ) contains
> two select elements, a text element, a TEXTAREA element and a Submit button.
> The submit button starts the next java script code:
>
>          form.action="sz_i.jsp";
>          form.submit();
>
> The sz_i.jsp program inserts records into an oracle database, and at the end of the 
>process
> the program is finished with the following command: response.sendRedirect(...)
>
> I created a javabean to read the request parameters of sz_i.jsp page.
>
> import java.util.Enumeration;
> import javax.servlet.http.*;
>
> public class PostParamBean {
>   String hova = null;
>   Enumeration kulcsok;
>   HttpServletRequest objektumom;
>
>   public void setHova(String hova) {
>        this.hova = hova;
>   }
>
>   public void setObjektumom(HttpServletRequest objektumom) {
>        this.objektumom = objektumom;
>   }
>
>   public HttpServletRequest getObjektumom() {
>        return objektumom;
>   }
>
>   public String getHova() {
>        kulcsok = objektumom.getParameterNames();
>        String param = hova;
>        int elso = 0;
>
>        while(kulcsok.hasMoreElements())
>        {
>           String kulcs = (String) kulcsok.nextElement();
>           String ertek = objektumom.getParameterValues(kulcs)[0];
>           if ( elso > 0 )
>           {
>              param = param + "&";
>           }
>           elso++;
>           param = param + kulcs + "=" + ertek ;
>        }
>        return param;
>   }
> }
>
> I called the bean from my application:
>
> <jsp:useBean id="postom"
>      scope="page"
>      class="ferrinfo.szerz.PostParamBean">
> <jsp:setProperty name="postom" property="objektumom" value="<%= request %>"/>
> <jsp:setProperty name="postom" property="hova" value="sz.jsp?"/>
> </jsp:useBean>
> .
> .
> .
> response.sendRedirect(postom.getHova());
>
> My problem is the following:
>
> - When I entered one row to the TEXTAREA field then my routine worked and
>   performs the page again - so every process O.K.
>
>   http://10.1.16.75:8180/hello2/sz.jsp?tbeall=first111%20first22222&tfelhaz=710&tcege
>   =78&tsapazon=sap&tkulso=1&tutana=&tmuvelet=0
>
> - When I entered two or more rows to the TEXTAREA field then the sz.jsp page aborted.
>   The string were cut by %0D%0A characters.  Is my javabean wrong ?
>
>   http://10.1.16.75:8180/hello2/sz.jsp?tbeall=textaream
>
> I looked at the header of sz_i.jsp program when the main program (sz.jsp) started the
> sz_i.jsp program:
>
> http://10.1.16.75:8180/hello2/sz_i.jsp?tmuvelet=0&tcege=78&tfelhaz=710&tkulso=1&t
> sapazon=asdfadf&tbeall=firsttttt%0D%0Aseconddddd&tutana=eeee
> The %0D%0A characters still right here.
>
> Is there problem in my javabean ?
>
> Thank you in advance....
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

--
Dror Matalon
Zapatec Inc
1700 MLK Way
Berkeley, CA 94709
http://www.zapatec.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to