Hi, i am using a JSP login page through which i reach to the home page after successfull login. but on home page when i click on any submit button i got back again on the login page . Even i am not using any session tacking. Here is my code please tell me if any problem in it. <%@ page language="java" import="java.util.*,java.sql.*,com.gipl.JSPLib.*" pageEncoding="ISO-8859-1"%> <% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; %> <% String fname, lname, user, country; JSPFormatFunctions jsfff = new JSPFormatFunctions("local"); JSPSiteFunctions jssf = new JSPSiteFunctions("local"); JSPValidations jsv = new JSPValidations("local"); int count = 0;
Its is bot a good idea to use scriplets. You can make use of MVC design pattern which will prove very helpful in maintaining your code. Are you using basePath to direct your page to some location? [ December 18, 2008: Message edited by: Himanshu Gupta ]
You have to keep in mind that all request parameters are in request scope. When you are hitting submit button then a new request is going to the server and it knows nothing about the previous request. To solve this you can put the parameters in the session. It will be better if you rework your code following MVC pattern. It will not only give you easy to maintainable code but also help you on debugging your application more easily.