For you == operator you need to use the equals(java.lang.String) method.
See the java implementation for more info.
Chris Heinemann
-----Original Message-----
From: Noah Nordrum [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 03, 1999 3:08 PM
To: Java Apache Users
Subject: Really lame problem that is messing me up.
It might be that I am VERY tired and sick, but I can't figure out why
this isn't working.
It seems that if I go to
"http://localhost:8080/servlets/WebStore?action=test"
shouldn't the following code produce a page that says "BILL GATES
BLOWS"?
When I do this with no arguments it creates the MainPage, but if I do it
with
arguments(?action=test) it produces a page that says "test".
This is really messing me up right now.
Unfortunatly I think I can't rationally blame this on M$.
Thanks in advance.
Linux 2.0.36
Apache 1.3.6
JServ 1.0b3
JSDK2.0
JDK1.2
--
public void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
res.setContentType("text/html");
PrintWriter out = res.getWriter();
String action = req.getParameter("action");
if (action == "" || action == null)
{
new MainPage(out);
}
else if (action == "test")
{
out.println("<HTML><BODY>BILL GATES BLOWS</BODY></HTML>");
}
else
{
out.println("<HTML><BODY>" + action + "</BODY></HTML>");
}
--
==============================================================
Noah Nordrum
[EMAIL PROTECTED]
http://www.newfrenchbakery.com/
2:54pm up 130 days 20:05 hours
==============================================================
----------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]
----------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
READ THE FAQ!!!! <http://java.apache.org/faq/>
Archives and Other: <http://java.apache.org/main/mail.html/>
Problems?: [EMAIL PROTECTED]