Results 1 to 4 of 4
  1. #1
    rbabu1988 is offline Member
    Join Date
    Jan 2012
    Posts
    5
    Rep Power
    0

    Default How to get variable in jsp from servlet?

    pls can anybody tell , how to read the variable in jsp from servlet and how to map the url-pattern in web.xml file.

  2. #2
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default Re: How to get variable in jsp from servlet?

    Could you give us a little more background to your problem and give us some example code of what you're trying to do?

    Your question is unclear.

  3. #3
    rbabu1988 is offline Member
    Join Date
    Jan 2012
    Posts
    5
    Rep Power
    0

    Default Re: How to get variable in jsp from servlet?

    In jsp how to receive a data from servlet?
    In servlet we use request.getParameter("name"); to get a variable from jsp, so what is the code for receiving that parameter value from servlet to jsp.

  4. #4
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,013
    Rep Power
    20

    Default Re: How to get variable in jsp from servlet?

    I think you misunderstand the technology.
    JSPs are servlets. At least that is what they become.
    A JSP does not create a request...that comes from the client browser.
    The content of the HTML page displayed by the browser may have been generated by a JSP, but it is not a JSP.

    Your servlet forwards to a JSP, in the same way it could forward to another servlet...so the JSP can use the contents of the HttpRequest as though it were the original target of the request.

Similar Threads

  1. Replies: 1
    Last Post: 08-23-2011, 11:12 AM
  2. using a static variable in a servlet
    By rajkumar_g in forum Java Servlet
    Replies: 1
    Last Post: 10-16-2010, 07:12 PM
  3. Replies: 1
    Last Post: 12-02-2008, 12:23 AM
  4. Instance Variable In Servlet
    By javarishi in forum Java Servlet
    Replies: 3
    Last Post: 06-14-2008, 08:28 AM
  5. Replies: 1
    Last Post: 08-07-2007, 03:47 PM

Posting Permissions

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