How to import ligin name to other page..

hi..
i am making a application in tomkat 5.0 using JSP.first i am checking the authentication through a login page then forwarding it to a connect.jsp for authentication.after the if authorised then redirecting to a welcome page..i am using Mysql database 4 my application..but my problem is that i am not able to inport the login name for my welcome page.plz. help me and give me some suggetion ,how would i import login name so that i can show it in welcome page..
code of connect.jsp is..
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<%@ page import="java.sql.*" %>
<%
String username=request.getParameter("user");
String password=request.getParameter("pwds");
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/test","root","nisha");
Statement stmt=con.createStatement();
String vsql="select * from login where uname='"+username+"' and pwd='"+password+"'";
ResultSet rs=stmt.executeQuery(vsql);
if(rs.next())
     response.sendRedirect("welcome.jsp");
else
     out.println("Wrong username or password");
}catch(ClassNotFoundException e)
out.println(e);
%>
</body>
</html>
thanx
nisha
Edited by: nisha.gill20 on Jul 10, 2008 11:42 PM

Nishaji..
response.sendRedirect("welcome.jsp");This doesnt look good for me..use request dispatcher to forward to ur jsps or servlets..then u can make use of ur request object to pass ur uname like request.setAttribute...and get the name back in ur welcome.jsp page..
i recommend some reading on servlets and jsps that will make u understand more than what I said rite now..:)
[email protected]
Edited by: mshanu on 11 Jul, 2008 12:16 PM

Similar Messages

  • How to remove responsibilty name custom oaf page

    Hi,
    Can any one please help me how to remove the responsibility name custom oaf page.
    i developed custom oaf page.while opening those pages responsibility name is also displyed.
    but i dont want to be displayed responsibility name in page.
    Please help me how to remove name of the responsibility in oaf page.

    Hey hi there ,
    I think you are trying to hide the Product branding that appears right next to the corporate image ( Oracle image ) ,
    well you can do this using controller code , in processRequest of your controller add this code
    Import :
    import oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean;
    import oracle.apps.fnd.framework.webui.OAFormattedTextHelper;
    import oracle.apps.fnd.framework.webui.beans.OAFormattedTextBean;
    OAFormattedTextBean bean =
    (OAFormattedTextBean)createWebBean(pageContext, FORMATTED_TEXT_BEAN,null,"product_brand");
    bean.setText(" ");
    OAPageLayoutBean page = pageContext.getPageLayoutBean();
    page.setProductBranding(bean);
    Once you compile and run the page notice that Product branding will no longer appear on the screen .
    Try this and let me know if its not working .
    --Keerthi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to modify the names of existing Pages styles?

    In Pages 5.5.2 under Yosemite 10.10.2.
    1. How to modify the name of an existing style in both the Main styles list, and also in the Bullets & Lists styles list?
    2. How to delete unwanted styles from both styles lists?
    3. How to modify the default formulas for Bullets & Lists styles and make them stick for future documents?
    Appreciated.

    Click on it and you get the Formatting options for the selected text.
    If I had meant the Menus, I would have added that, but all the above is what you see when you have a document open in Pages 5.5.2.
    The > are clearly progressive steps. Except for the ">" which appears in the pop up menu, so I put it in quotes.
    I always assume that people on the forum will make some effort themselves, but can bring it down a notch if needed.
    Peter

  • How can I create links to other pages in iBooks that will function in PDF?

    Hi,
    I know some people have asked previously how to create links to other pages of their book within iBooks. I having an issue with this myself that I haven't been able to resolve. I am able to create the links, and they seem to function within the program, however, once I export the document as a PDF file (the format in which I need to have this ebook!), the links seem to be non-functional. Does anybody have a fix for this?
    Thank you so much for any suggestions you may have!! I really need to figure this out for my client.
    Regards,
    Meggyn

    Exporting as a PDF does alter/lose/remove certain functions. Adobe Acrobat has its own page navigation system.
    A lot of the hidden engine of iBooks Author is basically very similar to building a website! so links and books marks are an "internal" function.
    IF you  have Acrobat and not just the Adobe Reader, you can make links.  I have never needed to try, but  I see a working link related index  in the many software manuals  I have.

  • How to keep layout changes in other pages

    I am just starting with iWeb and came across a question. When I choose a theme for a website and make the 'welcome' page, but change some layout things, colours, positioning of textboxes, is it than possible to copy those changes in the other pages like 'about' and so? Or do I have to copy the first page over and over? In the least case I will have a problem with the albums and slide show I guess?

    Welcome to the Apple Discussions. iWeb doesn't have the capability of carrying over layout changes from the first page to additional pages. If you plan on using the same theme frequently create a second site, add each page type that you might use, make the layout changes to each one and save. Then if you need a photo page in your working site duplicate the photo page in the "layout" site and drag it up to the working site.
    You can send a feature request to the iWeb developers via http://www.apple.com/feedback/iweb.html.
    OT

  • How to put Author name and other book/magazine information into iTunes

    Hi,
    I'm trying to organize my pdf's in iTunes (and while I'm at it, I'm putting some web magazines in as well).  I know to highlight the title and press Command/I to edit information, but categories like "author", "publisher" don't come up even though I can sort by those fields. 
    Is there a way in iTunes to add that information/tag to my pdf's? 
    Thanks

    This is why I think iTunes, in its present form, is completely unsuited for cataloging eBooks. However you can do what you want to do with the existing tags. Since a picture is worth a thousand words, here's a screen cap for you to illustrate how:
    And the various other sorting options:
    Give all that a try and see how it works for you.

  • How to retrieve resource name in JSP page

    Hello,
    I have the following scenario:
    User wants a new resource to be provisioned to himself, he makes standard steps; chooses one resource from the list of available resources and sends a request. After that a summary page is displayed - my goal is to create an url to external application on that summary page (i.e. tjspRequestSubmitTiles.jsp) that should be displayed depending on the name of the resource, e.g. if user requests for a ResourceA - link appears, but when he requests for a ResourceB - link does not appear.
    So far I have created a link with a sample if statement - it works.
    My problem is how to make a real condition - retrieve the resource name that request deals with. Anybody know how to do that, which API to use etc.?
    Regards,
    Maciej.

    After adding the code to tjspProvideDataShowInfoTiles.jsp file, nothing has been improved, I am still facing the same result (on the console):
    RO: null
    It seems that file (tjspProvideDataShowInfoTiles.jsp) does not take part in the process.
    I have tried to pass some sample session attribute in tjspRequestVerificationTiles.jsp and this works, but I do not know how to retrieve resourceName in this file.
    I was trying to make some code retrieving resourceName in tjspRequestSubmitTiles.jsp, e.g.
    tcRequestWizardForm tcReqWizForm = (tcRequestWizardForm)session.getAttribute(requestWizardForm);
    String requestID = tcreqWizForm.getRequestID();
    ...and what to do now to retrieve resourceName?

  • How to import jsp file in other jsp file

    I am using JSP for a website and my database is in Oracle. I want to connect to Oracle database in one jsp file such as connection .jsp.
    Then I want to use this same connection in all the jsp files by importing the jsp file. (I know in Core java we can do this by import statement e.g. import connection.java) but how can I do this in jsp. whwn i am importing connection.jsp using <%@ page import=connection.jsp%> It is showing errors.
    Plz help me. It's very urgent.
    Thanks in advance.

    Thats because import is for importing packages as any jsp tutorial could have told you. You are looking for include:
    <%@ include file="connection.jsp"%>

  • How to import jsp files into other jsp files ?

    hi i have the following code mymainpage.jsp
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
    <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;" >
    <title>Sagem Module</title>
    </head>
    <body>
    <f:view>
    <rich:modalPanel id="panel" width="350" height="100">
            <f:facet name="header">
                <h:panelGroup>
                    <h:outputText value="Modal Panel"></h:outputText>
                </h:panelGroup>
            </f:facet>
            <f:facet name="controls">
                <h:panelGroup>
                    <h:graphicImage value="/images/modal/close.png" styleClass="hidelink" id="hidelink"/>
                    <rich:componentControl for="panel" attachTo="hidelink" operation="hide" event="onclick"/>
                </h:panelGroup>
            </f:facet>
            <h:outputText value="This panel is called using Component Control Component"></h:outputText>
            <br/>
            <h:outputText value="Closure link (X) works also through Component Control"></h:outputText>
        </rich:modalPanel>
    <h:form>
        <h:outputLink value="#" id="link">
            Show Modal Panel
            <rich:componentControl for="panel" attachTo="link" operation="show" event="onclick"/>
        </h:outputLink>
    </h:form>
    <f:view>
    </body>
    </html>can i put the model panel into another file for example modalpanel.jsp and then include it into my page mymainpage.jsp such
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
    <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html;" >
    <title>Sagem Module</title>
    </head>
    <body>
    <f:view>
    //**** import modalpanel.jsp
    <h:form>
        <h:outputLink value="#" id="link">
            Show Modal Panel
            <rich:componentControl for="panel" attachTo="link" operation="show" event="onclick"/>
        </h:outputLink>
    </h:form>
    <f:view>
    </body>
    </html>

    Use jsp:include.
    parent.jsp
    <f:view>
        <h1>Parent</h1>
        <jsp:include page="child.jsp" />
    </f:view>child.jsp
    <f:subview id="child">
        <h2>Child</h2>
    </f:subview>(note the f:subview!)

  • How to import catalog structure in other machines.

    Hi,
        I have two queries.:-
       1).   I have a Clothing Catalog on my machine which I created in ACC. How do I import this catalog structure in other machines as well.
       2).  How to specify CatalogId in my project if I have multiple Catalogs in my project.
             For a single Catalog I used to mention catalog Id in catalogTools.properties in /atg/commerce/catalog/catalogtools.properties as :-
             defaultCatalogId=catalog30001
             How to I do it for multiple catalogs.
    Please Advice.
    Thanks

    Go to dyn/admin compoent path,
              say in this case u created catalog data from acc, Go to /atg/commerce/catalog/productCatalog compoent
              and run <export-items item-descriptors=""/> Provide item descriptors name. under  'Run XML Operation Tags on the Repository' section.
             It will export all data for given component and it's dependancies.if u wan to disable dependancies specify skiP-references="true"
    To import and export data u can use /ATG_HOME/bin/startSQLRepository command only in dev envirnoment.
    startSQLRepository- m ModuleName -export/import export_file_name -repository repository_component_full_path
    eg:-
    startSQLRepository -m YourModule -export export.xml -repository /atg/commerce/catalog/ProductCatalog
    startSQLRepository -m YourModule -import export.xml -repository /atg/commerce/catalog/ProductCatalog
    Please make sure you module is able to connect to database,Otherwise jtdatasource exception will come, saying not able to connect datasouce atgmysqldb(default db configured in jtdatasoruce property)
    Also if u want to export complete db,Use all argument.
    startSQLRepository -m YourModule -export all export.xml
       2. U have multiple options to set catalogid in profile.
    use multisite and assign default catalog to individual sites,
    assign catalog to regiestered user profile.
    Use scenario to assign catalog to profile based on some rules.

  • How to change table name after creating page and application

    Hi HTMLDB Team,
    i have created a application with page where the region use master detail form with table name emp.Now after developing the page and the application i want to change the table from emp to emp2 where emp2 is the table with same structure of existing emp and same field properties.How can i edit the table as emp2 ?
    Thanks in advance,
    Cheers,
    koushik

    Koushik,
    Depending on the amount of customizations that you did, it may be easier to use the wizard to re-create the master-detail form & report.
    If you still want to give it a go:
    Assuming that you created the 2-page Master Detail report & form:
    On the first page, you will have to chage the SQL to reflect the new table name. Once you do that, you'll have to re-create the link on the EMPID column.
    On the second page, you'll need to do some more work. You'll have to change both Page Rendering Processes: Fetch Row from EMP and Get Next or Previous Primary Key. You'll then need to change the Page Processing Process: Process Row of EMP. Also, ensure that you have a proper Foreign Key relationship between EMP2 and DEPT (or your detail table).
    Thanks,
    - Scott -

  • How to Import Chapter Names Created in Premiere Pro CS6 to Encore CS6?

    I edited a sequence in Prmiere Pro CS6 and then I created and named all my Encore Chapter Markers while still in Ppro. I then opened Encore CS6 and used the Adobe Dynamic Link to import my Premiere Pro CS6 sequence into Encore CS6 and created a new timeline from that sequence. I imported a Menu (which I created in Photoshop) and linked the first chapter to button 1 in my menu and then used Create Chapter Index to bhild all the menus. How do I get the Chapter names to automatically appear in these menus without having to retype each one?

    Select a button and look at properties. Check the option "Set Name From Link." You can select multiple buttons and do them at one go.

  • When I open a pdf file on the net, I can only view page 1. How do I get to the other pages?

    When I open a pdf file on the net, I can only view page 1 and cannot move to page 2, 3, etc. How can I change pages?

    See [[Firefox keeps opening many tabs or windows]]
    You can have infinite tabs opening if you have selected Firefox as the application to handle a file if you get an ''Open with'' download window.
    Firefox should not be selected as the application to handle a file and you have to remove the action that is associated with that file type.
    You can delete [http://kb.mozillazine.org/mimeTypes.rdf mimeTypes.rdf] in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder] to reset all actions or set that action in Tools > Options > Applications to 'Always Ask'.
    See http://kb.mozillazine.org/File_types_and_download_actions ("File handling in Firefox 3 and SeaMonkey 2" and "Reset Download Actions")

  • How to carry forward subtotal to other page in smartforms

    Hi all,
                My requirement is to calculate the subtotal of a particular page and to print that subtotal
                at the end of each page.And this subtotal has to be carry forwarded as the first item of the next page(say page2).
                And again  at the end of this page(page2) I have to print the subtotal and needs to carry forward this subtotal again on to
                the first item of the page3..
               My problem is I am doing it in a table.I am calculating the subtotal and displaying the subtotal at the footer of the table..
               In the footer again I am redefining table work area values with the text 'Subtotal' and subtotal Amount so that thinking
               that it would print as first line item on the next new page....
              But the problem is I am getting subtotal as 2'nd line item on each new page instead of first line item of each page.........
              Can anyone resolve this issue.........
              I dont want this subtotal to be printed on the last page since I am getting Total of all these subtotals.....
              Below is my required structure
    Page 1.
                    Desc                               Amount
                    x                                      100
                    y                                      200
                   Subtotal                            300
    Page2.(Required page2)
                 Desc                               Amount                                
                    a                                      100
                    b                                      200
                   Subtotal                            600
    Page2.(But getting as below,which I dont require )
                    Desc                               Amount
                     a                                     100
                   Subtotal                            300
                     b                                      200
                   Subtotal                            600
    Page3.(Required page3)( I dont require Subtotal here on the last page)
                 Desc                               Amount                                
                    a                                      100
                    b                                      200
                   Total                                 900
    Any suggestions pls
    This is in Smartform
    Thanks,
    Chinnu

    Hi ,
    First define the global variable for subtotal & grand total
    In the first page display the table data normally  and if you dont want to print the headers of the table check the condition in the header  AT START OF TABLE
    calculate the grand totals  (Ex. g_tot = g_tot + wa_vbap-kwmeng)
    Ex.    page1   layout   (Note :  next page as page2)
    Header window
    main window
    final window
    In the final window  create an alternative node  (in flow logic )
    for alternative node put the condition as 
    sfsy-page  =  sfsy-formpages 
    if true
               print the data as   TOTAL   &g_tot&
    else (False node)
               print the data as   SUBTOTAL   &g_tot&
    Out put will be
    page1 o/p
    sales order         material            orderqty
    1                          M10                 10
    2                          M11                 20
    3                          M12                 30
    sub  total                                     60               (g_tot value )
    page2 onwards o/p
    4                          M13                 30
    5                          M14                 20
    6                          M15                 15
    Total                                            125             (g_tot value )
    Let me know if any concerns  .........

  • From one user, how to get tables names of other user.

    hi all,
    now i connected to Oracle with one user let us assume 'pavan/pavan'. and i need to get the table names that are in user: pavan and in user: gupta (gupta/gupta).
    one way is,
    from Java, first get connection to pavan user, execute the query and store the results and disconnect to it and againg connect to user 'gupta', execute the query and add these results to first results.
    but this is very expensive and time consuming also.
    is there any query to get this one. or need to create 'Database Link' and access through that link.
    regards
    pavan.

    First you have to grant permission (like SELECT,UPDATE,DELETE....etc..) to PAVAN on objects that are belongs to GUPTA. Then you can make use the GUPTA user objects.
    Suppose you connected to PAVAN and you want see the data in table A which exist in GUPTA user.
    Connect GUPTA user first and execute following statement
    GRANT SELECT,UPDATE,DELETE ON A TO PAVAN;
    After executing the above query connect to PAVAN user and execute following statement.
    SELECT * FROM GUPTA.A;

Maybe you are looking for

  • Connectivity Issues with USB 3 ports on macbook pro

    Hi,  I have a zoom r24 which is no longer working as an audio interface with my new macbook pro.  I have read a lot about issues with USB 2 devices not being compatible with USB 3 ports on the macs. This seems to be midi as well as audio devices.  Ca

  • How do I get my phone out of voice control and can not scroll or use it

    How do I get my phone out of voice control and can not scroll or use it?

  • Editor stuck in read only mode

    Am able to connect to a 9i database, but am unable to edit any code. Logon appears successful, connection made, and am able to query the database. However, when I open stored procedures for editing, the edit window doesn't respond to any keystrokes.

  • Reusing functions in ActionScript Classes

    I have an MXML Component which I am using as a Base Class for other components that share similar functionality. The Extended Classes use some of the same functions. Those functions perform no logic in the Base Class, but are called by Event Listener

  • My 1 year warranty

    Do i still get my 1 year warranty if i dint buy my iphone from an apple store?