in your test1.jsp
you should use
<input type=text name="txttest1" value='<%=test%>'>
then you will see the difference.
charles
-----Original Message-----
From: Juan Fu [mailto:[EMAIL PROTECTED]]
Sent: 18 June 2001 17:40
To: [EMAIL PROTECTED]
Subject: how to display a string with white space and double quotes in
text box
Hi,
I am currently using JSP to write a HTML page. I am encountering a string
problem. Here is my code.
--------test.htm ----------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<form name=test method=post action="test1.jsp">
<input type=text name=txt>
<input type=submit value="Submit">
</form>
</body>
</html>
----------------------------------------
---------- test1.jsp --------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<% String test=request.getParameter("txt");
System.out.println(test);
%>
<form name="test1">
<input type=text name="txttest1" value="<%=test%>">
</form>
</body>
</html>
If user entered a string like this:
He said:"I saw you yesterday."
Then when user clicks the submit button, only He said: is displayed in the
test1.jsp page. Can anyone tell me how to make the string contains with
white space, double quote and single quote work?
Thank you in advance.
Juan
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.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://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
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://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets