Results 1 to 8 of 8
  1. #1
    lema is offline Member
    Join Date
    Apr 2008
    Posts
    38
    Rep Power
    0

    Default get data from servlet to html

    hallo folk,

    here is the thread from where this thread occured get data from html to servlet

    the question is, after getting data (username, password) into servlet, and after checking the user's authorizatin in servlet through a server-side-mehtod, can i get an approval data (for example boolean b) back to jsp page. if (b) open application page, else error page..

  2. #2
    javarishi is offline Member
    Join Date
    Apr 2008
    Posts
    91
    Rep Power
    0

    Default

    I dont understand why jsp want to be a controller. See JSP Is Meant For

    Only presenting the data. Your Logic Or Controller Part should be

    handled by Servlet. Did you get it?

  3. #3
    javarishi is offline Member
    Join Date
    Apr 2008
    Posts
    91
    Rep Power
    0

    Default

    Hei Lema, In Servlet You create the RequestDispathcher Object.

    Then Write Simple If Condition. If user exists forward him to exact page

    else

    error.jsp

  4. #4
    lema is offline Member
    Join Date
    Apr 2008
    Posts
    38
    Rep Power
    0

    Default

    ..so it means i can't use any data from servlet in jsp, right. then i gotta get back to the old problem - opening applicatin page from servlet in the same browser.

  5. #5
    javarishi is offline Member
    Join Date
    Apr 2008
    Posts
    91
    Rep Power
    0

    Default

    Yes You Can. You Need To put the date in Httpsession, or Cookie

  6. #6
    lema is offline Member
    Join Date
    Apr 2008
    Posts
    38
    Rep Power
    0

    Default

    in httpSessin i save the the object User. and i save it after checking the user's authorization.
    here is how i log in and send username&password to servlet

    <table>
    <tr>
    <td>Username: </td>
    <td align = "left" width="20"><input name="username" type="text" size="40"></input></td>
    </tr>
    <tr>
    <td>Password: </td>
    <td align = "left" width="20"><input name="password" type="password" size="40"></input></td>
    </tr>
    <tr><td>
    <input type="submit" name="enter" value="Enter SMD"></input>
    </td></tr>
    </table>
    </form>


    the question is, how can i open the application page on same browser after checking the authorization? how? in jsp page through onClick, or in servlet through Dispatcher?

  7. #7
    javarishi is offline Member
    Join Date
    Apr 2008
    Posts
    91
    Rep Power
    0

    Default

    Lema,
    If you use dispatcher and not putting the data in session

    then what is happening?

  8. #8
    Join Date
    Apr 2008
    Posts
    64
    Rep Power
    0

    Default

    Quote Originally Posted by javarishi View Post
    Lema,
    If you use dispatcher and not putting the data in session

    then what is happening?
    hi rishi,

    I've the same problem.. i used requestdispacher but den too i was not able to get the values.. can u suggest??

    regards

Similar Threads

  1. get data from html to servlet
    By lema in forum Java Servlet
    Replies: 66
    Last Post: 04-09-2008, 02:43 PM
  2. Replies: 0
    Last Post: 04-04-2008, 09:36 AM
  3. Getting HTML form values in Servlet
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-17-2007, 08:13 PM
  4. How to retrieve data from servlet
    By valery in forum Java Servlet
    Replies: 1
    Last Post: 08-06-2007, 08:25 PM
  5. how to upload a file along with html form data
    By pranith in forum Java Servlet
    Replies: 3
    Last Post: 07-30-2007, 02:33 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
  •