Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > receive POST in a jps

Reply
Thread Tools

receive POST in a jps

 
 
Sigi
Guest
Posts: n/a
 
      01-25-2007
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


 
Reply With Quote
 
 
 
 
javajedi
Guest
Posts: n/a
 
      01-25-2007

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


On 26 Ocak, 00:29, "Sigi" <(E-Mail Removed)> 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


 
Reply With Quote
 
 
 
 
Alex Hunsley
Guest
Posts: n/a
 
      01-27-2007
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
>
>

 
Reply With Quote
 
Daniel Pitts
Guest
Posts: n/a
 
      01-27-2007


On Jan 25, 2:29 pm, "Sigi" <(E-Mail Removed)> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How does 'jps' identify all the JVMs on the current host? John Java 1 11-17-2005 09:03 PM
quantity of JPS's/Servlets vs. resource consuming Przemek Klein Java 0 10-06-2005 12:20 PM
JPS Error -> "Invalid Doc Flavor" MattC Java 1 07-25-2005 09:08 AM
Having trouble printing with JPS, Invalid flavor Brennan Mann Java 0 07-03-2004 07:48 PM
JPS 1.4: unit of measurement in the printDialog() =?ISO-8859-1?Q?J=F6rg_Marti?= Java 0 08-12-2003 06:18 AM



Advertisments