Jeff Schnitzer
Sat, 07 Jan 2006 14:38:59 -0800
Dan, want access? Jeff Dan Finkelstein wrote:
Hi Peter,I had the same problem last summer and made two modifications to Maverick. My app must be able to adjust to any charset based on locale. I'm pasting in the changes I made below. If someone can commit them to the maverick source that would be even better!! Anyway, let me know how you find these changes.Good luck, Dan In AbstractTransformStep.java, change topublic HttpServletResponse getResponse() throws IOException, ServletException{ log.debug("Getting fake response"); // Should be ok to wrap the real mccoy here. if (this.fakeResponse == null) {this.fakeResponse = new FakeHttpServletResponse(this.getTransformCtx().getRealResponse());// added by DF 7/26/05 // allows propogating character encoding on to responsefakeResponse.setContentType("text/html; charset=" + getTransformCtx().getRequest().getCharacterEncoding());} return this.fakeResponse; } In Dispatcher.java, change to public void init() throws ServletException {// Make us available in the application attribute collection this.getServletContext().setAttribute(MAVERICK_APPLICATION_KEY, this);// Get defaultRequestCharset from init parameter, null is ok // CLOWN added by DF 7/26/05 -- allows pulling default char set from app defaultRequestCharset = (String)this.getServletContext().getAttribute(INITPARAM_DEFAULT_REQUEST_CHARSET);if(defaultRequestCharset == null) {this.defaultRequestCharset = this.getInitParameter(INITPARAM_DEFAULT_REQUEST_CHARSET);}// Get limitTransformsParam from init parameter, null is ok this.limitTransformsParam = this.getInitParameter(INITPARAM_LIMIT_TRANSFORMS_PARAM);// Get reuseMaverickContext from init parameter, null is ok this.reuseMaverickContext = "true".equals(this.getInitParameter(INITPARAM_REUSE_CONTEXT));At 09:05 AM 1/5/2006, Peter Chase wrote:Is anything wrong with the following patch, to make Maverick transforms automatically pick up the character encoding? public FakeHttpServletResponse(HttpServletResponse wrapMe) { super(wrapMe); if (log.isDebugEnabled())log.debug("Creating fake response, original buffersize is "+ wrapMe.getBufferSize());this.charset = wrapMe.getCharacterEncoding(); // THIS ISTHE NEW LINE } -------------------------------------------------------This SF.net email is sponsored by: Splunk Inc. Do you grep through log filesfor problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click [INVALID FOOTER]-------------------------------------------------------This SF.net email is sponsored by: Splunk Inc. Do you grep through log filesfor problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click [INVALID FOOTER]
------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click [INVALID FOOTER]