Posted on 2006-03-28
Last Modified: 2010-04-01
I've a login screen made in jsp...

Now i've this .....


        public boolean isBetween(Calendar fromTime, Calendar toTime) {


                Calendar c1 = Calendar.getInstance();

                if( c1.after(fromTime) && c1.before(toTime) )

                        return true;

                 return false;




 and this ..



                 //void set(int year, int month, int date, int hour, int minute, int second)

                 // IMP : Jan is 0

                //Calendar fromTime = Calendar.getInstance();

                //fromTime.set(2003, 3, 21, 0, 0, 0);


                //Calendar toTime = Calendar.getInstance();

                //toTime.set(2002, 5, 7, 0, 0, 0);


                Calendar fromTime = Calendar.getInstance();

                fromTime.set(2006, 03, 17, 9, 0, 0);


                Calendar toTime = Calendar.getInstance();

                toTime.set(2006, 04, 04, 0, 0, 0);

               if(isBetween(fromTime, toTime)) {

                   forward to down.jsp


i need to forward....where do i place this code so that it checks the time fist before loading.....
urgent help required...thankz
Question by:jagadeesh_motamarri
    1 Comment
    LVL 11

    Accepted Solution


    If you wish the above piece of code to be checked before the requested page is loaded. You can do the following

    If suppose user requested for x page, then first you make the action to page y, check the code in page y and forward it to page x when it satisfy the condition.

    You can directly use request dispatcher in the jsp as follows:
    request.getRequestDispatcher("/relative/path").forward(request, response);


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Title # Comments Views Activity
    logging jar 1 100
    rebasing and merging used in SCM 1 56
    EJB MDB example 4 73
    JavaScript parse form with colon separated values 2 46
    I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
    PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    6 Experts available now in Live!

    Get 1:1 Help Now