Results 1 to 2 of 2
  1. #1
    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    Default Get a urlquery id sent by a getContext().showDocument() from another applet

    Hi everyone,
    im new to this forums and ive been banging my head against the computer trying to get the related topic to work,so let me try to explain the scenario, i have created several applets(forms) which they are interacting with the database, so i have a login form in the first index.htm page..so depending on what user you log in, it will be checked the permission, rather you are an administator,user(students) or a teacher, so each user has a specific control panel , so if you log in as a user it will get your student id and send to another applet via getContext().showDocument("URL")+resultset.getStri ng("StudentID"),however i cant grab the ID from the other applet, i have tried the URL.getQUery() method but to no avail, i cant get the numbers, all i can have is the studentcontrolpanel.htm?id=, more specificly the "id=" i cant get the numbers after the = , and i need the studentID and also the adminID or TeacherID in order to retrieve from the database the student grades and records and for the admin it will use its ID to write in the database who have altered the Subscription, and for the teacher it will use the ID to get their disciplines when they rate the students,so i will post a piece of code so you guys can have an idea of what i am trying to achieve:
    Java Code:
     if(rsLogin.next())
                {
                    JOptionPane.showMessageDialog(null, "User sucessfully Logged in!");
                   if(rsPermission.next() )
                    {
                        if(rsPermission.getNString("PERMISSION").contains("User"))
                        {
                            if(rsId.next())
                            {  
                                    try { 
                                        StudentURL = new URL("http://localhost:8084/WebAppServMain/studentcontrolpanel.htm?="+rsId.getNString("MATRICULA").toString());
                                        } catch (MalformedURLException ex)
                                        {
                                            Logger.getLogger(LoginForm.class.getName()).log(Level.SEVERE, null, ex);
                                        }
                              
                               
                                getAppletContext().showDocument(StudentURL );
                                  
                                
                                
                                
                            }
                        
                        }
    so as you guys can see i am sending na ID via appletContext() but i cant get the id numbers from another applet class(form),it is sending the numbers though the browser but i dont know how to grab it ,can anyone help me out with this?
    any help is greatly appreciated!
    Thanks in advance,
    Ogre3dProgrammer

  2. #2
    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    Default Re: Get a urlquery id sent by a getContext().showDocument() from another applet

    Hi all,
    Im just passing by to say that i got my problem sorted out, i figured out a way to grab the url id , so the way to achieve it, is to use the following methods ,getDocumentBase().openConnection.getURL.getQuery( ), that way Works for me..
    kind regards,
    Ogre 3d programmer

Similar Threads

  1. Replies: 3
    Last Post: 01-19-2012, 08:19 AM
  2. Replies: 0
    Last Post: 10-17-2011, 05:48 PM
  3. Replies: 30
    Last Post: 08-26-2011, 09:05 PM
  4. applet working in applet viewer, not browser
    By plasticfood in forum Java Applets
    Replies: 4
    Last Post: 06-24-2011, 06:47 PM
  5. Replies: 4
    Last Post: 06-08-2007, 06:15 AM

Tags for this Thread

Posting Permissions

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