How to Open another jsp page from jsp page

Hi,
I am new to JSP. I need help to handle issue given below:
I have created one JSP Page for Login which contains Username and Password with a Submit Button. Once user inputs UserName and Password and Press Submit Button, It calls another JSP Page "Validate_login"
Validate_Login JSP does a JDBC call to Databse and validate User Name and Password. Now i want to open a "Employee.jsp" page if Username and Password matches with the one in database.
Pls advice what function or tag should i use to open this page in If (condition) true section.. I tried Window.open but it return back with error.

I tried with the function suggested by Doly. But nothing is happening. It doesn't redirect to any page. only a blank page comes.
here is complete code . pls correct me if i am wrong somewhere.
this is code of Validate_Login.jsp page which is invoked when user press login button on login.jsp.
my purpose is to validate username and password from database and redirect to employee.jsp if it is ok else back to login.jsp
here is source of Validate_login.jsp
=============================================================
<%@ page language="java" import="java.sql.*" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Validate Login</title>
</head>
<body>
<%
String username = request.getParameter("username");
String password = request.getParameter("password");
String viewPATH = "c:/MyData.mdb";
String dsnPATH = "jdbc:odbc:DRIVER=Microsoft Access Driver (*.mdb); " +
"DBQ="+viewPATH+"; " +
"UserCommitSync=Yes; " +
"Threads=3; " +
"SafeTransactions=0; " +
"PageTimeout=5; " +
"MaxScanRows=8; " +
"MaxBufferSize=2048; " +
"DriverId=281; " +
"DefaultDir=C:/ProgramFiles/CommonFiles/ODBC/DataSources";
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try
     Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
     conn = DriverManager.getConnection(dsnPATH, "", "");
     stmt = conn.createStatement();
rs= stmt.executeQuery("SELECT * FROM Employee where emp_id='"+username+"'");
while(rs.next())
String pass = rs.getString("password");
if (pass.equals(password))
{ response.sendRedirect("Employee.jsp");}
else
{ response.sendRedirect("login.jsp");}
catch(Exception e)
e.printStackTrace();
finally
     if(stmt!=null) stmt.close();
     if(conn!=null) conn.close();
%>
</body>
</html>

Similar Messages

  • How to open a word document from OA page

    Hi,
    I have a requirement where in the file names are displayed in a table .When the user clicks on the file name the file should open .The docs are basically word docs.
    Any idea how to implement this.
    I saw a post related to this in which someone suggested to use symlinks in Apache.Not sure how to do that.
    Thanks
    Anna

    Hi Kiran,
    host('winword.exe <pass ur resume path>');
    hope this could work out....just try...good luck
    Regards
    Thobula Rakesh

  • How to open another Swing Screen from a click on a button

    hi All
    i want to open a screen on a click on a button also tell me what is the correct way does i write the internal frame and add all gul components in constructor or call some other function by creating it object in actionperformed method of button
    PLZ Help

    If you want to use JInternalFrame then you have
    JDesktopPane. you add all the internal frames in JDesktopPane.
    while JDesktopPane is added in the main JFrame.
    something like this
    JFrame mainFrame=new JFrame("main Frame");
    JDektopPane desktopPane=new JDesktopPane();
    mainFrame.getContentPane().add(desktopPane);
    JInternalFrame iFrame=new JInternalFrame();
    /....your logic and iFrame settings.
    desktopPane.add(iFrame);--
    As per buttons, I think those buttons are the buttons added in JToolbar

  • How to get the form reference in .js page from .jsp page

    hi
    i have written one form in jsp page omething like:-
    <html:form action="/shopping" onsubmit="return false;">
    can anybody tell me,how to get the form reference in .js page from .jsp page ,
    i have tried:-
    var formRef = document.forms[0];
    butits not working.
    Thanks.

    Its very simple......y cant u prefer google...Bad
    c this example...
    function submit()
    alert("textbox"+ document.forms[0].name.value);//to get textbox value in js
    document.forms[0].submit();//to submit jsp page using js
    <html:html>
    <html:form action="/shopping" onsubmit="submit()">
    <html:text property=name>
    learn to search in google..
    </html:form>
    </html:html>

  • How do I copy and paste from one page or file to another page or file - on the same screen?

    How do I copy and paste from one page or file to another - on the same screen?

      Open both of your images in the Editor. Click on the image you want to copy and press Ctrtl+A (select all) followed by Ctrl+C (copy) then click the tab for your other image and press Ctrl+V (paste)
    Alternatively click on your background image then simply drag the second image from the photo/project bin and drop it into the main editor workspace on top of the background image. Use the move tool to position and the corner handles of the bounding box to scale.

  • How do i move an app from one page to another

    how do i move an app from one page to another? When I upgraded to the latest software on my 4s, the camera went to the last page rather than remaining on the home page

    What Rudegar says is true, but it's a lot easier to rearrange icons in iTunes:
    Connect your phone and open iTunes. 
    Click on the Apps tab. 
    You will see your home screen in the main window, with the other screens in a scrollable column on the right. Scroll down and click on the last page to put it in main window. 
    Now scroll the column so the home page is visible on the right.
    Click on the Camera and drag it onto the home page at the right. 
    Be careful not to accidentally insert it into another app, thereby creating a group.

  • How to call java script function from JSP ?

    how to call java script function from JSP ?

    i have function created by java script lets say x and i want to call this function from jsp scriplet tag which is at the same page ..thanks

  • Calling custom OAF page from JSP page in Oracle apps

    Hi,
    I am working on a requirement to call a Custom OAF page from a JSP page in Oracle apps 11.5.10.
    I have registered the OAF page and defined a function for it. When we call this OAF page from JSP (without parameter), the page opens up
    URL: http://APPSURL:8020/OA_HTML/RF.jsp?function_id=27221&resp_id=50312&resp_appl_id=515&security_group_id=0&lang_code=US
    but as soon as I am trying to pass a parameter sr_id in the URL:
    http://APPSURL:8020/OA_HTML/RF.jsp?function_id=27221&resp_id=50312&resp_appl_id=515&security_group_id=0&lang_code=US&sr_id=106
    we are getting following error:
    You are trying to access a page that is no longer active.
    - The referring page may have come from a previous session. Please select Home to proceed.
    Please let me know if someone has faced the same problem...
    Thanks!!!

    Hi,
    Before calling a OAF page..from external JSP page...u need to set certain mandatory parameter like transaction Id and context.
    Regards,
    Gyan

  • How do I copy a page from one Pages document to another using Pages 5.0?

    I posted this question on another page, and haven't recieved an answer to it yet. However I have found a temporary solution, so I am posting this here in case anyone else has a similar problem.
    The issue here is that I have just upgraded from Snow Leopard to Maverick (10.9.1), and my Pages also upgraded (to 5.0.1), altering my Pages documents. This is the issue, as as far as I can see the new Pages does not offer some of the basic needs that the old Pages did! In other words it is worse than the previous version.
    Using the upgraded new Pages 5.0.1 seems to result in some major editing problems for me. If you upgrade, make sure you KEEP the old version of Pages 09 (v 4.3). That is what has saved me!  If you have the same problems I have had - explained below, you will still be able to close the new version and open your Pages document in the old version, provided it is not a new Pages document. If it is, it will be possible to export it as a Pages 09 document and edit properly.
    After upgrading to the new Pages 5.0.1, when I open documents in Pages and try and copy a section from one document to another (easy before using the thumbnails) many of the Menu items previously available are visible but appear faded and are not possible, including Insert>Section Break/Page Break/Page Number and Edit>Cut/Copy/Delete/Undo/Redo
    This even happens if I duplicate the Pages document and try and do any of these from the Duplicate (which should be an easily editable copy).
    My solution has been to simply open all Pages documents that Iwant to edit (or may want to edit in future) in the old Pages app (v 4.3), which I never got rid of. That has meant I can continue editing and copying a section (of 1 or more pages) from one Pages document to another.
    If anyone reading this has figured out a way to edit Pages documents using the new version 5.0.1 please post an explanation, and I will try it!

    And there are those who don't like me repeating the same message over and over again in this forum!
    Apple has removed over 90 features from Pages 5.
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Pages '09 should still be in your Applications/iWork folder.
    Archive/trash Pages 5, after Exporting your files to Pages '09, and rate/review it in the App Store, then get back to work.
    Peter

  • How to open Adobe Reader file from another native IOS application?

    There is an existing thread, but I want to re-open it because I think this is an important feature that we need badly.  I was wondering if there is any plan to add this feature so we can open PDFs directly into Adobe from the web / other apps.
    How to open Adobe Reader file from another native IOS application?
    Basically, we just want to use a custom URL scheme to open a specific document in the App.  Currently, this only opens the app but does not load the file.
    APB

    Not to hijack the conversation but I can explain why this would be useful for both the above case and another.
    What I believe Pavel is talking about is setting up a "URL Scheme" for the Adobe Acrobat iOS application so that you can easily open a PDF specifically in Adobe Acrobat iOS from other native applications and even from web applications opened within Safari. This is particularly useful if your application requires some of the specific features in Adobe Reader iOS to grant them the best experience possible and you want to encourage this.
    Another case: If you're using Adobe Livecycle's document security modules (that encrypts PDF files so that Adobe Acrobat must "phone home" to decrypt and view the document), these PDF's can only be viewed inside the Adobe Acrobat application and appear as blank in most other PDF readers. Having a URL scheme allows your application utilising this functionality to have a 1 click step to view the PDF rather than the current non-user friendly process:
    - Within Safari, touch the PDF link (appears as blank in the default Safari PDF reader, which in itself is confusing)
      - Touch "Open in..."
      - Touch "Adobe Acrobat"
    We have an immediate need for this functionality for the example above. I can resubmit it in a separate post if necessary.

  • Referencing static html pages from jsps...

              Hi,
              This is probably a very simple thing to solve, but I'm having problems with referencing
              html pages from jsps under Weblogic.
              I get Error 404 - not found, whenever I try something like this in a JSP...
              <frame name="title" src="title.html" scrolling=no>
              The title.html file has definitely been copied into my ear file, and yet it isn't
              found. I can solve the problem by turning title.html into a jsp and registering
              it in web.xml. But this seems like serious overkill with static content!!
              Am I missing something really simple here?
              

              I've worked it out - directory mistake...
              Thanks,
              Chris
              "Matt Krevs" <[email protected]> wrote:
              >it sounds like a relative pathing problem
              >
              >is title.html reachable if you enter its address in the browser?
              >
              >is title.html in the same directory as your jsp?
              >
              >perhaps you could post your web.xml file?
              >
              >"Chris Sceats" <[email protected]> wrote in message
              >news:3d9c41b5$[email protected]..
              >>
              >> Hi,
              >>
              >> This is probably a very simple thing to solve, but I'm having problems
              >with referencing
              >> html pages from jsps under Weblogic.
              >> I get Error 404 - not found, whenever I try something like this in
              >a
              >JSP...
              >>
              >> <frame name="title" src="title.html" scrolling=no>
              >>
              >> The title.html file has definitely been copied into my ear file, and
              >yet
              >it isn't
              >> found. I can solve the problem by turning title.html into a jsp and
              >registering
              >> it in web.xml. But this seems like serious overkill with static content!!
              >>
              >> Am I missing something really simple here?
              >
              >
              

  • How to open a java application from a web page?

    Friends
    I am in a situation to open a java application from a web page. I wrote a applet and placed a button on it. Onclicking of that button i con't open my java application. plz help me to open a userdefined application from web page.
    Ramesh
    e-Brahma technologies

    http://java.sun.com/products/javawebstart/index.jsp

  • How to call & pass values to custom page from seeded page table region

    Hi All,
    can anyone tell me how to call & pass values to custom page from seeded page table region(Attribute is not available in seeded page VO)
    it is urgent. plssss
    Regards,
    purna

    Hi,
    Yes, we do this by extending controller, but you can also try this without extending controller.
    1. Create Submit Button on TableRN using personalization.
    2. Set "Destination URI" property to like below
    OA.jsp?page=/<yourname>/oracle/apps/ak/employee/webui/EmpDetailsPG&employeeNumber={@EmployeeId}&employeeName={@EmployeeName}&retainAM=Y&addBreadCrumb=Y
    Give your custom page path instead of EmpDetailsPG.
    EmployeeId and EmployeeName are VO attributes(Table Region)
    If you dont have desired attribute in VO, then write logic in your custom page controller to get required value using parameters passed from URL path.
    In this case, only personalization will do our job. Hope it helps.
    Thanks,
    Venkat Y.

  • How can I print an envelope from a Pages document ?

    How can I print an envelope from a Pages document?

    Not from a document, but there are envelope templates in Pages you can use.

  • How can we export the data from OAF Page to Excel instead of .csv or .txt

    Hello,
    How can we export the data from OAF Page to Excel instead of .csv or .txt
    When i click on the export button it is exporting to txt file, But i need to export the data into Excel by default
    Please help me
    Thanks in advance
    Thanks,
    Raju
    We have changed the below profile option to get the data in excel by default
    Profile Name Export MIME type
    Profile Code FND_EXPORT_MIME_TYPE+
    Existing Value: text/tab-separated-values+
    Change as: Excel
    Thank you,
    Raju
    Edited by: 1006649 on May 21, 2013 10:55 AM

    We have changed the below profile option to get the data in excel by default
    Profile Name Export MIME type
    Profile Code FND_EXPORT_MIME_TYPE+
    Existing Value: text/tab-separated-values+
    Change as: Excel
    Thank you,
    Raju

  • Copy a page from one page group to another

    Hi
    Is it possible to copy a page from one page group to another?
    Regards,
    Lene

    Hi ,
    Through Portal it is not possible to copy a page from one page group to another .
    There is a feature in Portal WebDav .
    Through a DAV client you can copy page to your local system as a folder and then drag the page to the pagegroup you want to copy .
    Regards
    Medini

Maybe you are looking for

  • 'Session timeout" appears when creating account

    I am trying to create an iTunes account because I bought an iTunes gift card. Every time I try to create an account in the Music Store, and straight after I have accepted the terms and conditions, a screen comes up saying "Session timeout". I have ne

  • My phone is not showing up as a device on Find iPhone

    I have a phone and an ipad. When I go to Find Iphone to try to add my device, I cannot. I have turned on the locations settings, I have rebooted, I have updated my iCloud password and turned "on" everything that needs to be on. I have seen no fixes o

  • I get a memory stacking kernel panic when I startup Mac osx

    Can only boot into safe mode... When booted normally a black and white screen comes up with the aPple logo and a bunch of kernel code errors. I saw a pic online of someone else getting the same error message and the problem was referred to as a memor

  • Acrobat 7.0

    Hello Folks, I am editing a file using Acrobat 7.0 pro and want to edit bookmarks. I want to "Set Destination" of a bookmark but unable to do so as the option "Set Destination" is missing when I right-click on the bookmark. Please suggest me the solu

  • How to set the default DVD Burner (output device) in DVDSP 4.2.2

    For the life of me I can't find that click - default DVD Burner (output device) - but I can see where you can set it under both Build/Format and Format. Too bad it always goes back to the superdrive, which I never use. Thx!