Here is the simplest :))
=======================================================
index.jsp :
<html>
<body>
<jsp:useBean id="myBean" class="MyServlet" scope="session"/>
Here is the value of the String from the Servlet:
<%= myBean.getMyString() %>
</body>
</html>
=======================================================
MyServlet.java
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class MyServlet {
public String getMyString(){
return "This is my return String";
}
}
=======================================================
And that should be it. :))
ramiz - 17 Jul 2006 04:31 GMT
> Here is the simplest :))
>
[quoted text clipped - 30 lines]
>
> And that should be it. :))
thanks for ur reply
regards,
ramiz
> Hi geeks,
> I'm a beginner in jsp and servlets, i want a sample JSP-SERVLET
> applicaton with source code. Can you please tell me where can i get the
> sample applications.
> Thanks in advance...
Doesn't Tomcat install a default application? I'm sure it does,
although I'm not certain that it installs any JSP servlets. I think it
does because you can self test Tomcat with some of the default servlets.
Anyhoo, check your default app, probably some good examples there.
ramiz - 17 Jul 2006 04:33 GMT
> > Hi geeks,
> > I'm a beginner in jsp and servlets, i want a sample JSP-SERVLET
[quoted text clipped - 7 lines]
>
> Anyhoo, check your default app, probably some good examples there.
thanks for ur reply
regards,
ramiz