hi everyone:
i find something wrong in my following files.
i do not understant what is the effect of "<% if
(request.getParameter("usename")!=null) { %>" in the myjsp.jsp. if i input
nothing in the text form on the browser, server will response"Hello !"to me.
it is "null" for the variable of "usename"!? if this srciptlet is no effect
on my program, why is not there display of "Hello !" before i click the
"Submit" button.
please help! thank you.
javabean file:
public class HiBean {
private String usename;
public HiBean() {
usename=null;
}
public void setusename(String name){
this.usename=name;
}
public String getusename(){
return usename;
}
}
myjsp.jsp:
<html> <body>
<form method="get">
<input type="text" name="usename">
<br>
<input type="submit" value="Submit">
</form>
<% if (request.getParameter("usename")!=null) { %>
<%@ include file="response.jsp" %>
<% } %>
</body> </html>
response.jsp file:
Hello <jsp:getProperty name="hello" property="usename" />!
===========================================================================
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
- Re: about scpritlet liuhao
- Re: about scpritlet Shannon Moschetti
