Ying,
You should replace this code:
<h1>Hello, <jsp:getProperty name="mybean"
property="username" />!
</h1>
</td>
<td width="150">
<h1>
<jsp:getProperty name="mybean" property="pswd"/>!
</h1>
With this:
<h1>Hello, <%= mybean.getUsername() %>!
</h1>
</td>
<td width="150">
<h1>
<%= mybean.getPswd() %>!
</h1>
-----Original Message-----
From: Ying Sun [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 24, 2000 7:16 AM
To: [EMAIL PROTECTED]
Subject: Re: help
Hi there,
I work on this error for several hours,it give me the error message
C:\JavaWebServer2.0\tmpdir\default\pagecompile\jsp\_hellouser.java:109:
'}' expected.
out.print(_jspx_html_data[7]);
but I think I include the } in my file,enclosed please find the jsp file
Thank you in advance.
chris
<%@ page import="hello.NameHandler" %>
<jsp:useBean id="mybean" scope="page"
class="hello.NameHandler" />
<jsp:setProperty name="mybean" property="*" />
<html>
<head><title>Hello, User</title></head>
<body bgcolor="#ffffff" background="background.gif">
<%@ include file="dukebanner.html" %>
<table border="0" width="700">
<tr>
<td width="150"> </td>
<td width="550">
<h1>My name is Duke. What's yours?</h1>
</td>
</tr>
<tr>
<td width="150" </td>
<td width="550">
<form method="get">
<input type="text" name="username" size="25">
<br>
<input type="password" name="pswd" size="25">
<br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</td>
</tr>
</form>
</table>
<%
if ( request.getParameter("username") != null ) {
%>
<%@ include file="response.jsp" %>
<%
}
%>
</body>
</html>
response.jsp
<table border="0" width="700">
<tr>
<td width="150"> </td>
<td width="550">
<h1>Hello, <jsp:getProperty name="mybean"
property="username" />!
</h1>
</td>
<td width="150">
<h1>
<jsp:getProperty name="mybean" property="pswd"/>!
</h1>
</td>
</tr>
</table>
package hello;
public class NameHandler {
private String username;
private String pswd;
public NameHandler() {
username = null;
pswd=null;
}
public void setUsername( String name ) {
username = name;
}
public String getUsername() {
return username;
}
public void setPswd( String word ) {
pswd = word;
}
public String getPswd() {
return pswd;
}
}
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
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".
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