Originally posted by Sivakumar Jagadeesan:
Hi everybody
I am using tomcat3.1 in windows98 machine
it works fine
But i was not able to compile these program
ServletUtil.java
package test ;
public class ServletUtil {
public static final String DOCTYPE = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">";
public static String headWithTitle(String title){
return (DOCTYPE + "\n" +
"<HTML>\n" +
"<HEAD><TITLE>" + title + "</TITLE></HEAD>");
}
};
Hello.java
package test;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Hello extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException , IOException {
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println(ServletUtil.headWithTitle(" Hello WWW ") + "\n" +
"<BODY>\n" +
"<H1> Hello WWW -- BY Siva </H1>\n" +
"</BODY></HTML>");
}
};
These two file are present in the c:\tomcat\source\test
I am generating the class files in
c:\tomcat\webapps...\classes\test
when i compiled ServletUtil it did well , but when i compiled Hello.java the compiler was sayin that it can't undestand
ServletUtil.headWithTitle(" Hello wwww");
can u pls help me in this
Thank you
rgds
Siva
Originally posted by Dheeraj Thakur:
I've created an application using Entity Bean and have deployed it successfully using Inprise AppServer 4.0 but when I am calling this bean from my client program/servlet I get an exception which says...
javax.naming.NoInitialContextException: Need to specify class name in environment or system property: java.naming.factory.initial
and says it is something to do with the naming lookup (JNDI).
I tried to run the same application on another machine and it works fine there.
Can anyone tell me what setting needs to be done in the first machine to set this right.
Originally posted by Sankar Subbiramaniam:
Hi,
Currently i have installed Tomcat server. Now i want to learn and develop EJB. So i am planning to install Orion server. Will there be a conflict b/W Orion and Tomcat ? If so can i just use Orion server alone to run my servlets and JSP ?
Please help.
regards
sankar
Originally posted by sean cee:
Hi, I have an interesting Q for you!
public class AQuestion
{
public void method(Object o)
{
System.out.println("Object version");
}
public void method(String s)
{
System.out.println("String version");
}
public static void main(String agrs[])
{
AQuestion a = new AQuestion();
a.method(null);
}
}
will print "String version" according to the answer
I have no idea about this one..
AND if the (Object o) is replaced with (StringBuffer sb) then compiler error 'cos java doesn't know which method I am refering to.. so.. I guess there is something about Object class..
Can someone tell me why? Thanks.