Hi all, The following is the url used to display a jsp file. http://localhost:8080/JSP/calendar_main.jsp?a_month=0&source=login&agn_month=1&agn_day=0&agn_year=0 I'm using tomcat 3.2 In the page, a column displays a form so the user enters some info. and click on submit button. The form post to a servlet(Calendar_Servlet) and if everything is fine, it should redisplay the same jsp page(as url above) I want to reload the page because a javabean is created(in the servlet) and property are set. First I do a session.setAttribute("bean_name", bean_info) and I want to use getName() and other functions from the jsp page.
I use to following code : String _parent = "/JSP/calendar_main.jsp?a_month=0&source=calendar&agn_month=0&agn_day=20&agn_year=2001";
dispatch = req.getRequestDispatcher( _parent ); dispatch.include( req, res ); When the page is redisplayed, the new url displayed is: http://localhost:8080/servlet/Calendar_Servlet My question is why the above url? How come the url isn't setup using the value in getRequestDispatcher? Is the problem in server.xml ? I noticed the following: <RequestInterceptor className="org.apache.tomcat.request.InvokerInterceptor" debug="0" prefix="/servlet/" /> Is it where "servlet" (in the wrong url) is coming from? In server.xml, I changed servlet to JSP(where I keep all jsp/html files), I get a HTTP 404 page not found. The url is still : http://localhost:8080/servlet/Calendar_Servlet Any help would be appreciated. Thanks
I am having this same problem, and thought I couldn't use sendRedirect() as it wouldn't pass the information in the request? My app works fine the first time I submit my form, but once it reloads the JSP (using a RequestDispatcher), the url is incorrect and trying to submit it again produces an error telling me the resource (i.e., the servlet) is not available. Here is the code from the servlet:
Thanks in advance for any help, g. [ July 01, 2002: Message edited by: Garann Rose Means ]
Under Tomcat 4.x is a folder 'logs', in this folder is a file called 'localhost_log.<DATE>.txt'. This file contain the error from the JSP page. /Rene [ July 02, 2002: Message edited by: Rene Larsen ]
Regards, Rene Larsen
posted 18 years ago