I am confused, I am using an example with Tomcat4.0, See code snippets below:
/////////////////////////////////////SErvlet
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import model1.Foo;
public class FooServlet extends HttpServlet
{
public void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
String s[] = new String[] {"blue", "green", "red"};
Foo f = new Foo(s);
req.setAttribute("foo", f);
getServletContext().getRequestDispatcher("/foo.jsp").forward
(req, res);
}
}
//////////////////////////BEAN
public class Foo {
String s[];
public String[] getList() { return s; }
public Foo(String s[]) { this.s = s; }
}
///////////////////////////JSP Page
<html>
<usebean name=foo type=.Foo lifespan=page>
</usebean>
<ul>
<loop property=foo:list propertyelement=x>
<li> <display property=x>
</loop>
</ul>
</html>
////////////////////////Question I know that my path is wrong in the getServletContext().getRequestDispatcher("/foo.jsp").forward
(req, res);
But I dont get an exception even if I try to catch it, I am using
Tomcat 4.0 and Apache Question how can i get the correct path set to display this data source from bean to foo.jsp
here is my path
C:\jakarta-tomcat-4.0\webapps\InScopeFortKnox\IWA\foo.jsp
my browser path
http://rsmilgius:8080/InScopeFortKnox/IWA/login/foo.jsp this will show only a dot <UL> in the browser.
please direct me to setting the the correct request
getServletContext().getRequestDispatcher("/foo.jsp").//path to foo.jsp ???
Thanks in advance Ray
------------------
Sun Certified
Java Programmer
Sun Certified Java Developer
I-Net Certified
A+ Certified
Network+ Certified
MCP
[This message has been edited by Ray Smilgius (edited November 15, 2001).]