Re: Unable to change content-type with Interceptor?

2015-07-26 Thread Lukasz Lenart
2015-07-23 23:18 GMT+02:00 JOSE L MARTINEZ-AVIAL : > Hello all, >I was just looking for this option to override the content-type of the > json result. Is there any fix for this? Not sure what I have been referring to but JsonResult has contentType param defined https://github.c

Re: Unable to change content-type with Interceptor?

2015-07-23 Thread JOSE L MARTINEZ-AVIAL
Hello all, I was just looking for this option to override the content-type of the json result. Is there any fix for this? Thanks JL 2012-12-31 12:41 GMT-05:00 Lukasz Lenart : > 2012/12/30 Burton Rhodes : > > Lukasz - > > > > Thanks for all your help. You got me on t

Re: Unable to change content-type with Interceptor?

2012-12-31 Thread Lukasz Lenart
2012/12/30 Burton Rhodes : > Lukasz - > > Thanks for all your help. You got me on the right track and it appears the > json Result was what was overriding and setting the content type. As a > result, I have overridden the JSONResult class to use the "dynamic" > c

Re: Unable to change content-type with Interceptor?

2012-12-30 Thread Burton Rhodes
Lukasz - Thanks for all your help. You got me on the right track and it appears the json Result was what was overriding and setting the content type. As a result, I have overridden the JSONResult class to use the "dynamic" content-Type. /** * Custom json result type to set Co

Re: Unable to change content-type with Interceptor?

2012-12-30 Thread Lukasz Lenart
2012/12/30 Burton Rhodes : > HttpServletResponse response = (HttpServletResponse) > invocation.getInvocationContext().get(StrutsStatics.HTTP_RESPONSE); Maybe try to use: HttpServletRequest request = ServletActionContext.getRequest(); Regards -- Łukasz + 48 606 323 122 http://www.lenart.

Re: Unable to change content-type with Interceptor?

2012-12-30 Thread Lukasz Lenart
rridden once set)? As mentioned here [1] you can change content-type till getWriter is called or response committed [1] http://docs.oracle.com/javaee/5/api/javax/servlet/ServletResponse.html#setContentType(java.lang.String) Regards -- Łukasz + 48 606 323 122 ht

Re: Unable to change content-type with Interceptor?

2012-12-30 Thread Burton Rhodes
AM, Lukasz Lenart wrote: > 2012/12/30 Burton Rhodes : > > I'm not sure what I'm doing wrong, but I cannot for the life of me change > > the content-type of the response using an interceptor. My interceptor > code > > is below. The example below seems a bit abs

Re: Unable to change content-type with Interceptor?

2012-12-30 Thread Lukasz Lenart
2012/12/30 Burton Rhodes : > I'm not sure what I'm doing wrong, but I cannot for the life of me change > the content-type of the response using an interceptor. My interceptor code > is below. The example below seems a bit absurd, but eventually I will add > code to c

Unable to change content-type with Interceptor?

2012-12-30 Thread Burton Rhodes
I'm not sure what I'm doing wrong, but I cannot for the life of me change the content-type of the response using an interceptor. My interceptor code is below. The example below seems a bit absurd, but eventually I will add code to change the content-type dynamically from "appli

Re: Customizing "content type not allowed" error message

2009-07-03 Thread dusty
deploying to that effect: > > INFO: Loading global messages from msgs.properties > > In my action, I can even print out the text using the correct key and get > my custom message: > > getText( "struts.messages.error.content.type.not.allowed" ) > > H

Customizing "content type not allowed" error message

2009-07-02 Thread Wampole, Garrett C.
In my action, I can even print out the text using the correct key and get my custom message: getText( "struts.messages.error.content.type.not.allowed" ) However, when I submit a disallowed file using the form, I get the default error message: Content-Type not a

Re: Problem uploading files without content type

2009-06-18 Thread David Canos
it works in firefox! it's a chrome and safari issue! sometimes (depends on the file) this browsers don't set the content type. thanks Dave, you show me the key. I hope it helps the community 2009/6/18 Dave Newton > David Canos wrote: > >> if a try to upload a file

Re: Problem uploading files without content type

2009-06-18 Thread Dave Newton
David Canos wrote: if a try to upload a file without ContentType I get this: [ERROR] 10:39:39.953 (FileUploadInterceptor.java:intercept:263) org.apache.struts2.interceptor.FileUploadInterceptor Could not find a Content-Type for <*field*>. Verify that a valid file was submitted.|#] how

Problem uploading files without content type

2009-06-18 Thread David Canos
hi folks im using struts 2.0.14 if a try to upload a file without ContentType I get this: [ERROR] 10:39:39.953 (FileUploadInterceptor.java:intercept:263) org.apache.struts2.interceptor.FileUploadInterceptor Could not find a Content-Type for <*field*>. Verify that a valid file was sub

REST and JSON: null values, content type

2008-11-10 Thread Alex Milanovic
an empty array. Would it be more correct to serialize them as null? 2. The plugin sets the content type to text/javascript. I am not sure if application/json (http://www.ietf.org/rfc/rfc4627.txt?number=4627) is more appropriate? Thanks, Alex

Re: for review - split content type handler manager in REST plugin

2008-06-30 Thread Jeromy Evans
Jeromy Evans wrote: Could someone with an interest in the REST plugin please glance at the changes I've committed for WW-2641 oops, that was meant for struts-dev. I'll cross-post there. - To unsubscribe, e-mail: [EMAIL PROTE

for review - split content type handler manager in REST plugin

2008-06-30 Thread Jeromy Evans
Could someone with an interest in the REST plugin please glance at the changes I've committed for WW-2641 The change allows a different content-type in the request than the response. This was added specifically to allow a x-www-form-urlencoded request with a response in a different co

Loosing content type encoding in bean:include

2008-05-10 Thread Ignacio de Córdoba
as jsp:include or c:import handle correctly the page encoding. Ignacio -- View this message in context: http://www.nabble.com/Loosing-content-type-encoding-in-bean%3Ainclude-tp17168120p17168120.html Sent from the Struts - User mailing

Re: Default JSP content type

2008-04-03 Thread Laurie Harper
Page encoding yes; content type, not sure: http://java.sun.com/javaee/5/docs/tutorial/doc/bnajg.html L. Matthew Seaborn wrote: Does anyone know if it is possible to override the default JSP page content type and/or page encoding either for an entire web-app or as part of Struts 2? Many

Default JSP content type

2008-04-03 Thread Matthew Seaborn
Does anyone know if it is possible to override the default JSP page content type and/or page encoding either for an entire web-app or as part of Struts 2? Many thanks. Matthew Seaborn Software Architect t+44(0) 208 484 0729 m +44(0) 7949 465 142 e [EMAIL PROTECTED]<mailto:[EM

Re: Wrong Content Type text/plain

2007-04-12 Thread Antonio Petrelli
2007/4/12, Torsten Römer <[EMAIL PROTECTED]>: Antonio Petrelli wrote: I'll gladly wait. I'm already happy that it works now, and I am glad I tried Struts2 after making two minor webapps with JSF/MyFaces/Tomahawk/Tiles - maybe a cumbersome combination It seems that you did not try Shale (includ

Re: Wrong Content Type text/plain

2007-04-12 Thread Torsten Römer
Antonio Petrelli wrote: > 2007/4/12, Torsten Römer <[EMAIL PROTECTED]>: >> However the documentation states that "The latter [StrutsTilesListener] >> provides tighter integration with Struts features such as freemarker >> integration." so I wonder if this applies to the Tiles servlet as well >> an

Re: Wrong Content Type text/plain

2007-04-12 Thread Antonio Petrelli
2007/4/12, Torsten Römer <[EMAIL PROTECTED]>: However the documentation states that "The latter [StrutsTilesListener] provides tighter integration with Struts features such as freemarker integration." so I wonder if this applies to the Tiles servlet as well and if it would be better to use it ins

Re: Wrong Content Type text/plain

2007-04-12 Thread Torsten Römer
st fine on my Linux/Tomcat 5.5 >> development box but when I deploy the app to the provider's Linux/Tomcat >> 5.5 webspace the content type is suddenly text/plain instead of >> text/html and all I see is the HTML source. >> >> The funny thing is, that when a

Re: Wrong Content Type text/plain

2007-04-12 Thread Teemu Tapper
development box but when I deploy the app to the provider's Linux/Tomcat > 5.5 webspace the content type is suddenly text/plain instead of > text/html and all I see is the HTML source. > > The funny thing is, that when an action is executed through > > > > the conten

Wrong Content Type text/plain

2007-04-11 Thread Torsten Römer
I added Tiles to the struts2-blank-2.0.6 example webapp and started to work on my application. All works just fine on my Linux/Tomcat 5.5 development box but when I deploy the app to the provider's Linux/Tomcat 5.5 webspace the content type is suddenly text/plain instead of text/html and all

S2 XSLT Result Content-Type

2007-04-09 Thread Erik Costlow
I have a Struts2 action that uses an XSLT result to generate a final XHTML document that gets sent to the client. This action is sending the content-type of "text/xml" so IE6 is displaying the information as an XML tree, instead of showing a rendered html document. /xsl/defaults.xsl

Re: content-type

2006-06-06 Thread Scott Van Wart
Leo Asanov wrote: This wouldn't work for me because content type have to be different under different circumstances, but response.setContentType works just fine. Thanks!! Be very careful with this, as if you send anything but a text-based content type, you could be in for a surprise.

Re: content-type

2006-06-05 Thread Leo Asanov
This wouldn't work for me because content type have to be different under different circumstances, but response.setContentType works just fine. Thanks!! Cheers, Leo Bart Busschots <[EMAIL PROTECTED]> wrote: You can set it in the JSP like so: <%@ page contentType="text/xml&qu

Re: content-type

2006-06-05 Thread Bart Busschots
You can set it in the JSP like so: <%@ page contentType="text/xml" %> Leo Asanov wrote: Hi! Is it possible to change content type in action class? response.setContentType doesn't do anything. Content is html code, generated by a jsp file. What are my

content-type

2006-06-05 Thread Leo Asanov
Hi! Is it possible to change content type in action class? response.setContentType doesn't do anything. Content is html code, generated by a jsp file. What are my options? Cheers, Leo - Ring'em or ping'em. Make PC-to-phone ca

Re: Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread Frank W. Zammetti
quot;, "inline" ); BUT, when I get to the end of my action class, what do I return? I cant return to a JSP page because I've set the content type to be PDF (or excel) So, instead of mapping.findForward("success"); what can I do? On 5/12/05, *Frank W. Zammetti* <[EMAIL

Re: Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread Frank W. Zammetti
claration, but here's the real problem I'm in the action class, and I can can work on the response using response.setContentType("application/pdf"); response.setHeader("Content-disposition", "inline" ); BUT, when I get to the end of my action class, what do I

Re: Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread David Johnson
and I can can work on the response using > > > > response.setContentType("application/pdf"); > > response.setHeader("Content-disposition", "inline" ); > > > > BUT, when I get to the end of my action class, what do I return? I cant > > r

RE: Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread Benedict, Paul C
content type from an action Okay, I've got it opening the second browser (finally got back to it) using the target="_new" in the form declaration, but here's the real problem I'm in the action class, and I can can work on the response using response.setCon

Re: Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread David Johnson
quot;); response.setHeader("Content-disposition", "inline" ); BUT, when I get to the end of my action class, what do I return? I cant return to a JSP page because I've set the content type to be PDF (or excel) So, instead of mapping.findForward("success"); what can I

Re: Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread Frank W. Zammetti
t; >> The code would look like this: >> >> >> >> >> >> When the user clicks on the button, the action "exportToPdf.do" opens an >> ServletOutputStream and writes whatever you want. The headers are also >> set to the content-ty

Re: Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread David Johnson
- > > From: David Johnson [mailto:[EMAIL PROTECTED] > > Sent: Thursday, May 12, 2005 11:17 AM > > To: Aladin Alaily; Struts Users Mailing List > > Subject: Re: Opening a NEW browser for a 2nd content type from an action > > > > whoa that's simple. I'm tryin

RE: Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread Benedict, Paul C
ssage- From: David Johnson [mailto:[EMAIL PROTECTED] Sent: Thursday, May 12, 2005 11:17 AM To: Aladin Alaily; Struts Users Mailing List Subject: Re: Opening a NEW browser for a 2nd content type from an action whoa that's simple. I'm trying that first Thanks One things though, I

Re: Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread David Johnson
ke this: > > > > > > When the user clicks on the button, the action "exportToPdf.do" opens an > ServletOutputStream and writes whatever you want. The headers are also > set to the content-type you want and the format you want (inline or > attachment). > > Ala

Re: Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread David Johnson
om > > On Thu, May 12, 2005 10:47 am, David Johnson said: > > hmm I dont think I understand. so instead of redirecting to an action > > mapping, just add the HTML myself, like you would if you were writing a > > servlet (no jsp) application? interesting. > > > > you'

Re: Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread Aladin Alaily
. The headers are also set to the content-type you want and the format you want (inline or attachment). Aladin > Hey all > > is it possible to forme my struts app to open up a second browser window > for > the purpose of streaming a different content type (like a pdf file) into >

Re: Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread Frank W. Zammetti
were writing a > servlet (no jsp) application? interesting. > > you're right, I dont need a nice tiles definition page for my pdf/xls > output.. all I really need is to pop up a browser, set the content type, > and > direct the response into the new browser. > > is there

RE: Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread Benedict, Paul C
second browser does not open). Thanks, Paul -Original Message- From: David Johnson [mailto:[EMAIL PROTECTED] Sent: Thursday, May 12, 2005 10:48 AM To: Benedict, Paul C; Struts Users Mailing List Subject: Re: Opening a NEW browser for a 2nd content type from an action hmm I dont think I

Re: Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread David Johnson
op up a browser, set the content type, and direct the response into the new browser. is there a way to target a browser like you can in a but using an ? like a target="pdfOutput" or something? that might work.. h On 5/12/05, Benedict, Paul C <[EMAIL PROTECTED]> wrote: >

RE: Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread Benedict, Paul C
cally. Thanks, Paul -Original Message- From: David Johnson [mailto:[EMAIL PROTECTED] Sent: Thursday, May 12, 2005 10:31 AM To: Struts Users Mailing List; CCNY Subject: Opening a NEW browser for a 2nd content type from an action Hey all is it possible to forme my struts app to open up a s

Opening a NEW browser for a 2nd content type from an action

2005-05-12 Thread David Johnson
Hey all is it possible to forme my struts app to open up a second browser window for the purpose of streaming a different content type (like a pdf file) into it while maintaining the page in the original browser? Essentially, I have a nicely rendered HTML report in browser "a" and