Results 1 to 14 of 14
  1. #1
    gb.rashu is offline Member
    Join Date
    Aug 2010
    Posts
    28
    Rep Power
    0

    Question how to link url with username and password

    Hello,

    how to link URL with Username and Password for accessing a webpage
    can anyone tell me the solution . am waiting for reply:confused:

    Thanks in advance

    Regards
    Rashmi

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,883
    Rep Power
    25

    Default

    What does the server expect to be on the URL?
    What kind of protocol is the URL?
    What kind of server?

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    And is this actually anything to do with Java?

  4. #4
    gb.rashu is offline Member
    Join Date
    Aug 2010
    Posts
    28
    Rep Power
    0

    Default

    Hello,

    HTTP protocol.
    Tomcat .
    i tried like <a href="http:url?action=login?user=abbb&pass=12345"> JAVA</a> but it works once, now it is not working . then IE is not supporting .can u tel me what is the solution for this?

  5. #5
    gb.rashu is offline Member
    Join Date
    Aug 2010
    Posts
    28
    Rep Power
    0

    Default

    NO.this link is using in jsp.i need to access website with username and password.

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    You mean this is HTML?
    URLs only have the one '?' in them.

    This is nothing (really) to do with JSPs, but this:
    <a href="http://whatever-url?action=login&user=abbb&pass=12345"> JAVA</a>
    should work. If it doesn't then you'll need to give us whatever error occurs...but I doubt this is really anything Java or JSP related.

  7. #7
    gb.rashu is offline Member
    Join Date
    Aug 2010
    Posts
    28
    Rep Power
    0

    Default

    actually file is JSP file. but this: <a href="http://whatever-url?action=login&user=abbb&pass=12345"> JAVA</a> works sometimes .
    no error occurs . it ll access website and asking username and password.i need to do like without asking username and password should access whatever -url i have given.

  8. #8
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    843
    Rep Power
    6

    Default

    here u want to pass url as string right? that means dynamically change the url ..see the bolded part for uir understanding.

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!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; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>

    [B]<%
    String url ="FormatExample/aaa.jsp";
    %>[/B]<a href="http://localhost:8080/<%= url%>">Edit Employee</a></body>
    </html>
    Ramya:cool:

  9. #9
    gb.rashu is offline Member
    Join Date
    Aug 2010
    Posts
    28
    Rep Power
    0

    Default

    Hello Ramya,Thanks for the response.
    i need to pass username and password with url, not only url both password and username.
    can you tell me the solution for this?
    Regards
    Rashmi

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    Are you doing this for multiple sites or something?

    I don't understand why the link you are using only works sometimes...

  11. #11
    gb.rashu is offline Member
    Join Date
    Aug 2010
    Posts
    28
    Rep Power
    0

    Default

    not multiple sites ,for only one site am doing this..

  12. #12
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    So, when you put this url:
    <a href="http://whatever-url?action=login&user=abbb&pass=12345"> JAVA</a>
    into your browser it doesn't always work?

    Then you need to see what the login action on the server is doing.

  13. #13
    gb.rashu is offline Member
    Join Date
    Aug 2010
    Posts
    28
    Rep Power
    0

    Default

    ok. i ll check in server

  14. #14
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    843
    Rep Power
    6

    Default

    in String url itself

    u dynamically assign like this below
    Get the username and password in one string and do like this below.we can do it in a matured way.As a start iam giving this example below.
    example:
    String username ="xxxx"
    String password ="yyyy"
    String url ="FormatExample/aaa.jsp";
    String finalUrl = url+"?action=login&"+username+"&pass="+passoword
    Ramya:cool:

Similar Threads

  1. Connecting to a url with Domain, username and password
    By getstarted in forum Networking
    Replies: 4
    Last Post: 03-11-2009, 01:11 AM
  2. password username and databases
    By chalo in forum JCreator
    Replies: 0
    Last Post: 12-02-2008, 09:11 AM
  3. username password verification
    By bheezee in forum JDBC
    Replies: 0
    Last Post: 11-25-2008, 07:55 PM
  4. Help, created a username and password box
    By cachi in forum AWT / Swing
    Replies: 1
    Last Post: 08-07-2007, 05:21 AM
  5. JTextFields with username & password.
    By Eric in forum AWT / Swing
    Replies: 2
    Last Post: 07-02-2007, 12:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •