• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

catch response returned by PHP in jsp

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a jsp which will submit an image to a php script. The script will resize the image and return true if it was successful or return and error. How can i catch the response from the php method and render the appropriate response on the jsp? The only way I can think of the redirecting from the php script upon completion to the jsp with a parameter in the url, doing a get and analyzing it to render the response in the jsp. Is there a better way of doing this?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the JSP forum.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'll need to explain what you are trying to do better. For example:

Adrian Airmil wrote:I have a jsp which will submit an image to a php script.

has no meaning.

You don't "submit" images. What do you mean by this? Are you submitting the URL of an image to the php script? Are you using an input of type image to trigger the request? Are you specifying the URL of the php script in an image tag? What?

As it's central to the discussion, not understanding what this means makes the question impossible to address.
 
Adrian Airmil
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:You'll need to explain what you are trying to do better.


Sorry for the confusion. What 'submit' means is that the jsp has a form. The user will use it to upload an image. The form action will be set to point to 'imageResizer.php'. The php script will acquire the POST details from the jsp, process the resize and return a response of true if the resize was successful or an error.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As with other responses, the response is sent to the browser, not the JSP. So your JSP isn't going to be able to do anything. It's gone.

Ajax wont help because it can't do file uploads (though jQuery will let you fake it).

Perhaps an iframe?
 
reply
    Bookmark Topic Watch Topic
  • New Topic