receive POST in a jps

Discussion in 'Java' started by Sigi, Jan 25, 2007.

  1. Sigi

    Sigi Guest

    Hi,
    is it possible in a JSP to receive data sent thru POST to that JSP? (without
    using a servlet)

    I tried with
    request.getAttribute("parameter")
    but it doesn't work.

    Thanks
     
    Sigi, Jan 25, 2007
    #1
    1. Advertising

  2. Sigi

    javajedi Guest

    try this: request.getParameter("parameter_name");


    On 26 Ocak, 00:29, "Sigi" <> wrote:
    > Hi,
    > is it possible in a JSP to receive data sent thru POST to that JSP? (without
    > using a servlet)
    >
    > I tried with
    > request.getAttribute("parameter")
    > but it doesn't work.
    >
    > Thanks
     
    javajedi, Jan 25, 2007
    #2
    1. Advertising

  3. Sigi

    Alex Hunsley Guest

    Sigi wrote:
    > Hi,
    > is it possible in a JSP to receive data sent thru POST to that JSP? (without
    > using a servlet)


    What the other guy said...

    I just want to add the detail that JSPs actually work by getting
    compiled to servlets behind the scenes. But yes, without explicitly
    writing a servlet, a JSP page can access the POST data.


    >
    > I tried with
    > request.getAttribute("parameter")
    > but it doesn't work.
    >
    > Thanks
    >
    >
     
    Alex Hunsley, Jan 27, 2007
    #3
  4. Sigi

    Daniel Pitts Guest

    On Jan 25, 2:29 pm, "Sigi" <> wrote:
    > Hi,
    > is it possible in a JSP to receive data sent thru POST to that JSP? (without
    > using a servlet)
    >
    > I tried with
    > request.getAttribute("parameter")
    > but it doesn't work.
    >
    > Thanks


    ${param.parameter}

    For instance. POSTing the value 'Bob' paramter named whodunnit to the
    url 'http://myhost.com/index.jsp' which contains '${param.whodunnit}
    did it' will product the output 'Bob did it'

    Although, its good practice to leave JSPs to doing what they do best,
    rendering from a template. You would be better to do all of your
    business login in a Servlet request (Controller), and then pass the
    results (Model) to your JSP (View). Struts Tiles is a good utility for
    this. As well as the Spring Framework and Spring MVC.
     
    Daniel Pitts, Jan 27, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?ISO-8859-1?Q?J=F6rg_Marti?=

    JPS 1.4: unit of measurement in the printDialog()

    =?ISO-8859-1?Q?J=F6rg_Marti?=, Aug 12, 2003, in forum: Java
    Replies:
    0
    Views:
    352
    =?ISO-8859-1?Q?J=F6rg_Marti?=
    Aug 12, 2003
  2. Brennan Mann
    Replies:
    0
    Views:
    2,891
    Brennan Mann
    Jul 3, 2004
  3. MattC
    Replies:
    1
    Views:
    2,591
    Thomas Weidenfeller
    Jul 25, 2005
  4. Przemek Klein
    Replies:
    0
    Views:
    371
    Przemek Klein
    Oct 6, 2005
  5. John
    Replies:
    1
    Views:
    410
    Roedy Green
    Nov 17, 2005
Loading...

Share This Page