Re: [Resin-interest] gzipfilter encoding problem for web.xml declared error pages

2010-03-31 Thread Alan Wright
Further to this is there any way to look at the response while in the 
Gzipfilter and prevent gzipping if the response is 403 (or any other 
error code for that matter)?

I think resin 2.1.17 is servlet 2.2 which has not got a 
response.getStatus() method, but given that you can specify the error 
page for given error codes in web.xml, there must be some way that the 
container is able to figure out the status. I was wondering if I could 
tweak the GZIPFilter class to use the same means of interrogating the 
response status.

If all else fails I can just disable gzipfiltering till we are able to 
upgrade but I would prefer not to.

Thanks

Alan


Alan Wright wrote:
 Hi

 We are using resin 2.1.17 (yes i know we need to upgrade!) and are 
 starting to implement role based access control using role declaration 
 on Struts actions.

 I have declared a 403 error page in web.xml and am experiencing a 
 problem which I have tracked down to interaction with the gzipfilter 
 because everything works beautifully with the gzipfilter disabled, but 
 with the filter enabled I am getting:

 Content Encoding Error

 The page you are trying to view cannot be shown because it uses an 
 invalid or unsupported form of compression.


 in firefox and equivalent errors in other browsers.



 I think that the response is being encoded twice by the time the browser 
 sees it.

 Has anyone come across this and figured out a way round it? 
 Is it a known issue with 2.1.17 gzipfilter that is resolved in later 
 versions of resin (if so what was the core issue)?
 Is it something to do with the web.xml declared error page being a 
 redirect that shouldn't be gzipped in the first place (just guessing here)?

 Any suggestions would be welcome

 Thanks


 Alan



   


-- 


Alan Wright
Athene Systems

tel 0845 230 9803


Athene Systems Limited
Registered Office:
Shieling House
Invincible Road
Farnborough
GU14 7QU

Registered in England and Wales No. 3156080



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] jsp:param behavior change from 3.0.22 to 4.0.5

2010-03-31 Thread Aaron Freeman
Oh, you will have to swap out the httputil with whatever you use to 
URLEncode strings in order to test it.


Thanks,

Aaron


On 3/31/2010 2:46 PM, Aaron Freeman wrote:

We are experiencing a fundamental change in how data is being passed as
a jsp:param between 3.0.22 and 4.0.5.  We need to know if this change is
intentional as it has a work-heavy impact on converting our code base
over which currently relies on the behavior of 3.0.x.

It appears that a call to jsp:include was automatically URL decoding any
strings that were passed in, and that that behavior has changed.

I have included source to two files that will demonstrate the behavior
change (in case it's not intentional).  And here are the results of
running it:

 on resin-pro-3.0.22 

URL encoded before pass to jsp:include:
Test%3A+1+%3C+2+and+width%3D%22100%25%22+and+ampersand%3D%26.

Test: 1  2 and width=100ïand ampersand=
Here it is as seen inside of test-process.jsp:
Test: 1  2 and width=100% and ampersand=.


 on resin-pro-4.0.5 

URL encoded before pass to jsp:include:
Test%3A+1+%3C+2+and+width%3D%22100%25%22+and+ampersand%3D%26.

Test: 1  2 and width=100ïand ampersand=
Here it is as seen inside of test-process.jsp:
Test:+1++2+and+width=100%+and+ampersand=.



%- BEGIN test.jsp -%
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %
%@ taglib uri=http://www.sendthisfile.com/taglib/httputil;
prefix=httputil %

c:if test=${!empty param.textarea}
  textarea param exists:br/
  ${param.textarea}br/br/

c:set var=textareaUrlEncodedBefore
value=${httputil:urlEncode(param.textarea)}/
  URL encoded before pass to jsp:include:br/
  ${textareaUrlEncodedBefore}br/br/
/c:if

%-- Set some requestscope variable in test.jsp --%
jsp:include page=/test-process.jsp
jsp:param name=textarea value=${param.textarea}/
jsp:param name=textareaUrlEncoded value=${textareaUrlEncodedBefore}/
/jsp:include

form action=/test.jsp

textarea name=textarea${requestScope.processedTextarea}/textarea

input type=submit/input

/form

c:if test=${!empty requestScope.urlEncoded}
  Here it is as seen inside of test-process.jsp:br/
  ${requestScope.urlEncoded}
/c:if
%- END test.jsp -%


%- BEGIN test-process.jsp -%
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %

c:choose

c:when test=${empty param.textarea}
c:set var=processedTextarea scope=requestTest: 1  2 and
width=100% and ampersand=./c:set
/c:when

c:otherwise
c:set var=processedTextarea scope=request${param.textarea}/c:set
/c:otherwise

/c:choose

c:set var=urlEncoded scope=request${param.textareaUrlEncoded}/c:set
%- END test-process.jsp -%


Thanks for your thoughts on this,

Aaron


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest
   




No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.791 / Virus Database: 271.1.1/2781 - Release Date: 03/31/10 
01:32:00

   


___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest


Re: [Resin-interest] jsp:param behavior change from 3.0.22 to 4.0.5

2010-03-31 Thread Scott Ferguson
Aaron Freeman wrote:
 We are experiencing a fundamental change in how data is being passed as 
 a jsp:param between 3.0.22 and 4.0.5.  We need to know if this change is 
 intentional as it has a work-heavy impact on converting our code base 
 over which currently relies on the behavior of 3.0.x.

 It appears that a call to jsp:include was automatically URL decoding any 
 strings that were passed in, and that that behavior has changed.

 I have included source to two files that will demonstrate the behavior 
 change (in case it's not intentional).  And here are the results of 
 running it:
   

I've added a bug report for this at http://bugs.caucho.com/view.php?id=3976.

I'll need to check, but there's a good chance this change was made to 
conform to either the JSP or JSTL spec/TCK.

-- Scott
  on resin-pro-3.0.22 

 URL encoded before pass to jsp:include:
 Test%3A+1+%3C+2+and+width%3D%22100%25%22+and+ampersand%3D%26.

 Test: 1  2 and width=100ïand ampersand=
 Here it is as seen inside of test-process.jsp:
 Test: 1  2 and width=100% and ampersand=.


  on resin-pro-4.0.5 

 URL encoded before pass to jsp:include:
 Test%3A+1+%3C+2+and+width%3D%22100%25%22+and+ampersand%3D%26.

 Test: 1  2 and width=100ïand ampersand=
 Here it is as seen inside of test-process.jsp:
 Test:+1++2+and+width=100%+and+ampersand=.



 %- BEGIN test.jsp -%
 %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %
 %@ taglib uri=http://www.sendthisfile.com/taglib/httputil; 
 prefix=httputil %

 c:if test=${!empty param.textarea}
  textarea param exists:br/
  ${param.textarea}br/br/

 c:set var=textareaUrlEncodedBefore 
 value=${httputil:urlEncode(param.textarea)}/
  URL encoded before pass to jsp:include:br/
  ${textareaUrlEncodedBefore}br/br/
 /c:if

 %-- Set some requestscope variable in test.jsp --%
 jsp:include page=/test-process.jsp
 jsp:param name=textarea value=${param.textarea}/
 jsp:param name=textareaUrlEncoded value=${textareaUrlEncodedBefore}/
 /jsp:include

 form action=/test.jsp

 textarea name=textarea${requestScope.processedTextarea}/textarea

 input type=submit/input

 /form

 c:if test=${!empty requestScope.urlEncoded}
  Here it is as seen inside of test-process.jsp:br/
  ${requestScope.urlEncoded}
 /c:if
 %- END test.jsp -%


 %- BEGIN test-process.jsp -%
 %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %

 c:choose

 c:when test=${empty param.textarea}
 c:set var=processedTextarea scope=requestTest: 1  2 and 
 width=100% and ampersand=./c:set
 /c:when

 c:otherwise
 c:set var=processedTextarea scope=request${param.textarea}/c:set
 /c:otherwise

 /c:choose

 c:set var=urlEncoded scope=request${param.textareaUrlEncoded}/c:set
 %- END test-process.jsp -%


 Thanks for your thoughts on this,

 Aaron


 ___
 resin-interest mailing list
 resin-interest@caucho.com
 http://maillist.caucho.com/mailman/listinfo/resin-interest

   



___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest