About Question enthuware.jwpv6.2.1086 :

Moderator: admin

Post Reply
RumiJal
Posts: 9
Joined: Wed Jul 12, 2017 10:51 am
Contact:

About Question enthuware.jwpv6.2.1086 :

Post by RumiJal »

if we use the attributes pageEncoding or contentType instead of errorPage with the same logic does the answer still the same?

Online
admin
Site Admin
Posts: 10034
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.1086 :

Post by admin »

Yes, since in case of an "action", the two jsp files are compiled and executed separately. So each page can have its own content type setting. The javadoc API description for setContentType explains it clearly:
Sets the content type of the response being sent to the client, if the response has not been committed yet. The given content type may include a character encoding specification, for example, text/html;charset=UTF-8. The response's character encoding is only set from the given content type if this method is called before getWriter is called.
This method may be called repeatedly to change content type and character encoding. This method has no effect if called after the response has been committed. It does not set the response's character encoding if it is called after getWriter has been called or after the response has been committed.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest