Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

submiting the output in same page

 
preethi Ayyappan
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to print "hi" in the same page after clicking a submit button.Is it possible in jsp?

Thanks
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
 
ujjwal soni
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You need to write on your jsp page


& on your form action handler redirect it to the same page.

 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ujjwal soni wrote:Hi,

You need to write on your jsp page



I would rather use taglibs/EL for this and certainly not scriptlets nor out.println stuff.


& on your form action handler redirect it to the same page.

Redirect?
 
ujjwal soni
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
redirect i mean by this
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, a redirect after an out.println()?
 
ujjwal soni
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
not really, i know it will throw a response already commited exception dude !!! It has to be written into a servlet or action file (if struts is used).

Hope you got it....
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure, I know how the stuff ought to work. I was just surprised about your "answer".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic