Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

interrupting JSP page

Thread view: 
Dražen Gemić - 15 Aug 2006 16:25 GMT
Let's say that I wan't to stop processing of JSP page.

I can do it by executing return statement in a JSP body.
It returns from compiled servlet 'service' method. If
I call <jsp:forward../> before it, I could redirect to
another page.

Besides being slopy, is there anything wrong that violates some
standard or causing unstable condition with this method ?

I know that I should resolve all the issues in a bean or servlet
that does actual data processing before JSP does the rendering,
but sometimes I just might need to do that.

DG
Andrea Desole - 15 Aug 2006 16:55 GMT
> Let's say that I wan't to stop processing of JSP page.
>
> I can do it by executing return statement in a JSP body.
> It returns from compiled servlet 'service' method. If
> I call <jsp:forward../> before it, I could redirect to
> another page.

just for clarity: forward doesn't redirect. With forward you can't see
the url of the new page in the browser. Returning from the JSP body is
also different: that just stops processing the JSP, without showing you
any other page.

> Besides being slopy, is there anything wrong that violates some
> standard or causing unstable condition with this method ?

don't think so. You only have to make sure that you call it soon enough,
so that the response hasn't been committed.
Dražen Gemić - 15 Aug 2006 22:27 GMT
>> Let's say that I wan't to stop processing of JSP page.
>>
[quoted text clipped - 7 lines]
> also different: that just stops processing the JSP, without showing you
> any other page.

I understand forward, and I know that there is a true redirect in
Servlet API. Using 'return' makes sense if jsp:forward is called
before it, in order to show me another page. Otherise I would get jus an
empty page.

>> Besides being slopy, is there anything wrong that violates some
>> standard or causing unstable condition with this method ?
>
> don't think so. You only have to make sure that you call it soon enough,
> so that the response hasn't been committed.

Thx

DG


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.