Hi everybody, I have some servlets written with jsps. I tested locally with the small server (original Tomcat server from Sun) which comes with jswdk package. I wonder if there is any free servelts/jsp host to test it online ? Thank you very much. regds maha anna [This message has been edited by maha anna (edited August 11, 2000).]
Perhaps a better place to find free jsp web hostings is Jason Hunter's website. He has a long list of jsp's ISPs, some of them are listed as free: http://www.servlets.com I haven't tried any of them. But give us some feedback once you have selected one.
Hi everyone, As I said earlier this is a feed back from Maha. I tried this site. In fact I am in the process of evaluating the site's server. Basically I just wrote small web authendication application which has all parts . 1. Some html pages 2. Some jsp pages 3. 2 servlets 4. One MySQl database This application basically gets a 'login' and a 'password' from a Html form and calls a LoginServlet, this login servlet calls business logic beans to validate the login and password (These Business logic beans basically talks to backend MySQl database) and creates a 'userView' viewbean and puts in session and redirects the request to the corresponding 'SuccessfulLogin.jsp' OR 'UnSuccessfulLogin.jsp'. I had written and tested everything with Sun's JSWDK server locally. All fine. I deployed the application in their server also. Everything works fine except this part. The jsp page is not retriving the dynamic data from the view bean which is put in the session. It displays null. I almost spent a whole day digging into all nook and corners. It seems to me that the jsp page gets FRESH BEAN everytime it is called instead of whatever the LoginServlet already put. Any idea why this beahviour? I sent a mail to the support team also http://www.webappcabaret.com. I understand you need some more details to understand the problem more clearly. So I put the details in the next post so that this post does not look longer at first. Thank you. regds maha anna
Here comes the details of the web appln. 1. I have a LoginServlet. The browser calls the servlet from a Html form with details of 'login' and 'password'. 2. This servlet calls business logic beans and verifies the login and password from the 'MySQL' database. 3. If the login and password both mathches, the servlet creates a 'viewBean' and puts in the session. Like the following. /*-------------Servlet code--------------*/ import app1.viewbeans.UserView; UserView userView; //create the userView object from the HttpRequest details session.putValue("userView", userView); response.sendRedirect("http://www.webappcabaret.com/maha/app1/login/body_successfulul_login.jsp"); /*-------------End of Servlet code--------------*/
and redirects to another .jsp page 4. The jsp page supposed to get the login parameter from the session bean named as 'userView' which is of class type app1.viewbeans.UserView. 5. The jsp file content is as follows. <jsp:useBean id="userView" scope="session" class="app1.viewbeans.UserView" /> Welcome! (emp id) <%= userView.getEmpCdStr() %> You have successfully logged in!
6. The 'UserView' bean has 2 members empCdStr and password and the corresponding 'set' and 'get' methods. 7.The viewbean is put in the session properly by the servlet BUT the jsp page is NOT displaying the <%= userView.getEmpCdStr() %> part. 8. When I debugged , it seems to me that the viewBean the Jsp page gets has got its empCdStr and password to be 'null'. I kindly request you all to overcome this hurdle. Other than this I am able to run a servlet/ display html page/ display a plain jsp page withour any <%= %> scripts / get MySQL database connection to my DB and process data etc. ONLY this part is pending. I almost spent the whole of today (Saturday) trying to debug this problem. I tested the same code with JSWDK package locally in my machine. The JSp page correctly displays the dynamic 'login' name locally. Once again thank you. /*-----------JSP file---------------*/ <HTML> <HEAD> <TITLE>Login Success</TITLE> <!--<BASE TARGET="_parent"> --> </HEAD> <BODY> <jsp:useBean id="userView" scope="session" class="app1.viewbeans.UserView" />
Hi! I am a jsp page ! :-)
Welcome! (emp id) <%= userView.getEmpCdStr() %> You have successfully logged in! </center> </BODY> </HTML> /*-----------End of JSP file---------------*/
I got this problem solved. I used the 'forward' technique instead of 'sendRedirect' from the servlet to redirect to the jsp pages. Now it works. The changed code is this : (now it works) getServletContext().getRequestDispatcher("/app1/login/body_successfulul_login.jsp").forward(request, response); //The previous code which does not work is this. response.sendRedirect("http://www.webappcabaret.com/maha/app1/login/body_successfulul_login.jsp"); regds maha anna