I'm almost afraid to ask this question as it seems too easy I must have
overlooked
something! I'm working on some code based around the jnt example in Larne
Pekowsky's
book "Java Server Pages.". For some reason characters in a form entry are
being encoded somewhere along the line before they get to a bean.
Cutting the irrelancies out of the code, basicaly there is a form jsp:
<FORM ACTION="storycreate.jsp" METHOD="POST">
<TEXTAREA ROWS="2" COLS="40" NAME="summary"></TEXTAREA>
<INPUT TYPE="SUBMIT" NAME="Submit" Value="Submit">
-------------------------------------------------------------------
storycreate.jsp:
<jsp:useBean id="article" class="jnt.ArticleBean"/>
<jsp:setProperty name="article" property="*"/>
<% article.insert(); %>
-------------------------------------------------------------------
and the articlebean set method:
public void setSummary(String summary) {
System.out.println("Setting Summary: "+summary);
this.summary = summary.replace('\n',' ');
this.summarySet = true;
}
-------------------------------------------------------------------
Now if a text line such as <img src="/pics/somepic.jpg">
is entered into the summary text area, the " characters make it to the
storycreat.jsp
page intact BUT by the time they make it to articlebean setSummary they have
become
? charcters.
Presumably they need to be encoded somewhere, any ideas where the correct
encoding should be going on. ? Should the Storycreate.jsp be encoding
"difficult"
characters ?
Thanks in advance
Andy C
R2 Project (http://www.r2-dvd.org)
Environment is:
winnt 2000 server,
Apache 1.3.12
Tomcat 3.2.1
mySql 3.23.28
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html