Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is it possible to stop the execution of a jsp page inside a scriptlet  RSS feed

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Please tell me if
Is it possible to stop the execution of a jsp page inside a scriptlet (if a particular condition is met ).

(I dont want to forward it to a different page)

Just need to show an alert and stop that part execution .

Please share your ideas .

Thank you

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Redesign the page so you don't have to: this kind of logic doesn't belong in a scriptlet.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on already developed code (Enhancements ) , so i have no option left .

Please tell me whether this is possible ??
 
Ankit Garg
Sheriff
Posts: 9608
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm not sure what you meant when you said that you want to alert and then abort execution of the page...
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Ankit .

Previously i was talking about alert is that , I will display the Alert and stop the execution .
 
Devaka Cooray
Marshal
Posts: 5322
575
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankit Garg wrote:


This may cause an error due to unreachable statements. Use <% if(true)return; %> instead.
Anyway these are not good techniques to use.
 
salvin francis
Bartender
Posts: 1479
21
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is my idea:
Even i agree such practices are bad and should not be done.


a cleaner way:



 
Ali Murtaza Shaikh
Ranch Hand
Posts: 55
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do it like this if you want to :

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!