Content Type and dispatcher.forward()
Hello,
I return a xhtml web page as a response of a servlet request. However, due to client issues I need that for some clients the header type is text/xhtml and for others is application/xhtml+xml. I make a response.setContentType(type) and then I do a dispatcher.forward to the xhtml page. However, the response always send the content-header=application/xhtml+xml (I suppose the default one for xhtml files). I have tried in several ways (for example using filters) but when I do a forward it always uses the above mentioned conten-header.
Is there any way of changing the content-type header when you use dispatcher forward?
Thanks.
Try with text/xhtml+xml and it will work
Similar Messages
-
When I change the settings to allow for the content type and page extraction and save it, it shows allowed. When I close the pdf, reopen it, review the security properties, it shows the content type as allowed and the page extraction as disallowed. I need both to stay at allowed, how do make this happen?
The moment that you select not to allow any kind of change done to the file then pages extraction is automatically not allowed as well. There's no way around that.
-
SRT: Wrong Content-Type and empty HTTP-Body received
Hi All,
I created and activated a web service for data acquisition in BI 7.0. The service has been activated and when do a test service from SICF transaction I get the following error page.
I appreciate any help to resolve this issue.
Thanks,
Jomon
- <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header />
- <soap-env:Body>
- <soap-env:Fault>
<faultcode>soap-env:Server</faultcode>
<faultstring xml:lang="en">SRT: Wrong Content-Type and empty HTTP-Body received</faultstring>
- <detail>
- <ns:SystemFault xmlns:ns="http://www.sap.com/webas/710/soap/runtime/abap/fault/system/">
<Host>undefined</Host>
<Component>COREMSG</Component>
- <ChainedException>
<Exception_Name>CX_SOAP_CORE</Exception_Name>
<Exception_Text>SRT: Wrong Content-Type and empty HTTP-Body received</Exception_Text>
</ChainedException>
</ns:SystemFault>
</detail>
</soap-env:Fault>
</soap-env:Body>
</soap-env:Envelope>good morning,
i am having the same problem, did you find an answer for this? can you update either this message, or reply back at your findings.
we are trying to get a external system to talk with ecc 6.0 thru sap connecter for .net v2.0.1. it worked with sap 4.6c, but not now.
any help is appreciated.
thanks. -
List with Multiple Content Types and Making new Forms...
I go to create custom forms based on content types. After I create using the wizard in the list it always shows the same form no matter which content type I pick.
what am I doing wrong?
David JenkinsYou can change the custom form on content type through SharePoint Designer. Do not change it on the content type directly, when you add content type in a list/library, then open list's content types in SP Designer and then select your content type and modify
the URLs of your custom display form.
I have updated a document in gallery for
step by step development of custom workflow and custom task form. In this document you can find the association of custom form with content type using SP Designer.
Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer :) -
Hi Team,
I need to access Java web service which is simple service and accepts and returns XML over HTTP. No credentials are needed to access the service. We need to pass following two HTTP headers (Content-Type and Authorization) along with XML request message:
<GetStatus> message is being constructed in the orchestration and URI is constant to access.
Which adapter shall I use to get the response back? I tried using WCF-WSHttp with Security Mode = Transport, and different options of client credential types but every time, error returned stating:
System.Net.WebException:
The HTTP request is unauthorized with client authentication scheme 'Basic'. The
authentication header received from the server was 'Basic realm='.
Authentication failed for principal Basic. Message payload is of type:
String
In Fiddler, request looks line following
POST <https://URL/GetServiceReopnse HTTP/1.1
Content-Type: application/xml
Authorization: Basic cmVmU3RhdHN2Y19kgeRfsdfs=
Host: <Server name>
<GetStatus XMLNS="http://server.com/.....">
<OrgId>232323</OrgId>
<HubId>3232342323</HubId>
</GetStatus>
MMK-007First, you should not use the HTTP Adapter because it's been deprecated and replaced by WCF.
Start with the WCF-Custom Adapter and select the customBinding.
You should start with the textMessageEncoder and httpTransport and go from there. -
Site content types and site columns were absent
hi,
i have seved a sub site as a template which includes 20+ doc libs with 20+ site content ctypes which includes 15+ site columns and then i have used this savedsite template in one site collection and implemented my
custom web parts and upload document fun. successfully.
now i have created another new site collection and forgot to create site content types and site columns as we have seen the site columns in the saved site template already.
now i realized that those site content types and site columns were not there but the strange thing is that i am able to uplaod the documents into those document libraries which are not associated with site content types, without any error.
Can I create the same in my new site collection ? since i have already created many many sub sites based on the saved site templates tested the functionality ,i dont wanna delete the template recreate all the sites again in order
to save the time.
Now pls advice:
1) if site columns / site contents were not existing at the site collection level, will this affect my func. in future?
2) is there any automated way fo creating site columns, site content types, associateing these site content types with doc libs programmatically like power shell/ sp object model API.
3) would like to any programmatic way of creating hundreds of sub sites based on the saved site templates in myw eb application/ site collection.Hi,
We can create site columns, site content types or sub-sites using SharePoint Server Object Model.
The following articles for your reference:
SharePoint 2010: Create Site Columns and Content Types using C#.Net
http://social.technet.microsoft.com/wiki/contents/articles/20267.sharepoint-2010-create-site-columns-and-content-types-using-c-net.aspx
How to: Add a Content Type to a SharePoint List
http://msdn.microsoft.com/en-us/library/office/aa543576(v=office.14).aspx
Create Sites Using Custom Site Templates in SharePoint 2010
http://www.c-sharpcorner.com/UploadFile/63e78b/create-sites-using-custom-site-templates-in-sharepoint-2010/
How to create sub site with custom site template through PowerShell
http://fangdahai.blogspot.com/2012/08/how-to-create-sub-site-with-custom-site.html
Best regards
Dennis Guo
TechNet Community Support -
Content type and SJSAS 8.1: how is it handled after all?
Hi,
I'm having a weird error while downloading certificate files from our SJSAS 8.1. For some files it sets the Content-Type, for others it does not. The GET request and its headers are always the same, but sometimes the response comes with a content type set, sometimes it sets the only the Accept-ranges header. Two examples follow:
GET /repositorio/certificadosemitidos/SerasaACP_2002.gsc HTTP/1.1
HTTP/1.1 200 OK
Server: Sun-Java-System/Application-Server
Date: Fri, 24 Mar 2006 15:18:22 GMT
Content-length: 1533
Last-modified: Tue, 27 Apr 2004 18:49:46 GMT
Etag: "5fd-408eab4a"
Accept-ranges: bytes
GET /repositorio/certificadosemitidos/78FC38A69B998586.gsc HTTP/1.1
HTTP/1.1 200 OK
Server: Sun-Java-System/Application-Server
Date: Fri, 24 Mar 2006 15:19:13 GMT
Content-length: 1818
Content-type: application/octet-stream
X-powered-by: Servlet/2.4
Etag: W/"1818-1143213520000"
Last-modified: Fri, 24 Mar 2006 15:18:40 GMT
Other thing is that the MIME types don't work. The app server ignores the types stated in the default-web.xml. Alright, but we need it to be at least deterministic when the file extensions are the same. The files I'm dealing with (these .gsc) are digital certificates in rfc printable format, but I don't think that should make a difference.
Anyone gone through anything similar?
Thanks a lot!
Jo�o.As long as you're using SJSAS to serve your port 80 traffic, default-web.xml should definitely be setting your mime type handling for the server. The only other things that will set this are custom settings in the web.xml for your individual applications, or specific mime types set by servelets you may have running in your application.
I've definitely set MIME types successfully just by editing default-web.xml and then bouncing the server.
Hope that helps somehow.
--Tad
Church of Scientology
http://www.scientology-washingtondc.org -
Several content types and default field value
Hi!
I have a document library with several custom content types (derived from standard Document type). One of them (CT1) has field with default value. Other content types must not contain this field. And when I upload document, this field has no default value.
If I make CT1 first (and default) content type in a library, default value appears. Also it works when I add the field to the first content type. But in my solution CT1 must not be the first content type in a library and the field must have default value (and
other content types must not have this field). Does anybody know how to make it?I understood why default value does not work. When we upload document to a library and then see a form with fields, it's not a newform, it's edit form. So when we upload a document, it gets first (default) content type of the library, only default fields
from this content type are filled. The solution here to fill default fields from other content types is to write itemadded event receiver. -
Attach a custom content type and set as default for picture library using client object model
Hi,
How to associate custom content type to a picture libraray and set it as default using the client object model?
ThanksHello,
Here you go:
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/b1de0697-0006-4f89-8909-1b94aa18ad89/how-to-reorder-content-types-in-list-with-client-context
http://www.niteenbadgujar.com/2013/05/change-default-content-type.html
Hope it could help
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
Custom content type and choice field
Hi,
I try to create costum content type in visual studio, and I want to add choice field to this content type, but I didn't found, how can I programmatically fill choice datasource
Can anyone help me?
Thanks,
MykieI've only done this one but I seem to recall packaging these up as XML as normal columns and sompl referenced them in the Content type definition. Having had a quick look on the inertubes for a refresher, I think this might point you in the right direction.
http://www.skylinetechnologies.com/Blog/Article/76/Creating-Lists-in-SharePoint-Using-Visual-Studio-2012.aspx
Something like this should be your end product.
Steven Andrews
SharePoint Business Analyst: LiveNation Entertainment
Blog: baron72.wordpress.com
Twitter: Follow @backpackerd00d
My Wiki Articles:
CodePlex Corner Series
Please remember to mark your question as "answered" if this solves (or helps) your problem. -
Problem about file content type and firefox
Hi,
The Firefox made me mad because cant do a simple job : download a XML file. I have a big XML file that crash Firefox when try to open it,
so download may be best choice but always Firefox start to show XML files. what is the solution?
It is first, second : I make my XML file using JavaScript and show it with data URL like this : data:text/xml;...
but same not work with csv files, I want when user save csv file, Firefox save it with .csv ext not .part
plz help me fast.Hi,
We use the file content convertion to conver the flat file that is text file into XML,
File adapter cant understand the format the file is,so we have to declare the content convertion parameters.
Check some links which will tell how the convertion is done.
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
/people/shabarish.vijayakumar/blog/2005/08/17/nab-the-tab-file-adapter
/people/jeyakumar.muthu2/blog/2005/11/29/file-content-conversion-for-unequal-number-of-columns
/people/shabarish.vijayakumar/blog/2006/02/27/content-conversion-the-key-field-problem
/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
Regards,
Phani
Reward points if helpful -
Content type headers and spam checks within Java MAil
Hello there
I have successfully created a java mail api to send any one of the following
plain/text message, with or without attachments, with or without the body of the email to be HTML
I have a question on how to ensure that the email is not marked spam? Sometimes the Spam score goes high if there is olly html for an email that is text/html type.;
What are the possible values for content/type of Mime Message header for following scenarios
An Email message that may have its bodypart as html and may have attachments
An Email message that will have plain text messages along with attahcments and HTML concattenated with text messages ( LIke google maps along with text message]
IF I do messaget.set ("This is my message") andthen I add attachments to the message body part, is it advisable to have two seperate content-type mime headers for these messages? wrt not having higher spam score.
Or Is it advisable to have seperate mime type content headers for text part and sperate for message part.
IS the attachment part also has a seperate mime header content type value?
does the header's content type value is plain/text for messages that are text messages with attachments>?
IS there a way to chek spam scores for messages generated by java mail? The ides is to create java mail API customsied sot hat the sent emails are not marked spams ?
In order for the mail to be having zero spam scrore, it is helpful to have seprate mime content type headers?
Edited by: user9328023 on May 23, 2011 1:45 PMIf you want to create a message that has both plain text and html versions of the main
message content, you want to create a multipart/alternative message, as described in
this FAQ entry.
If that message also needs to have attachments, you should embed the multipart/alternative
part in a multipart/mixed message, along with the attachment parts.
If the html part needs to reference images included with the message, you would replace
the text/html part with a multipart/related part, as described in this FAQ entry.
Combining all these techniques together can seem a bit complicated unless you understand
recursion! :-) Remember that in addition to creating a body part with a text content type,
you can create a body part with a multipart content type, and use that body part in the same
places you would use a text body part.
As for making sure your message isn't marked as spam, well, you're probably asking in the
wrong place, but the simple answer is to make sure that it's actually not spam! Usually the
structure of the message isn't as important as the content of the message. -
Document Sets and Content Types
Hi All,
I am having trouble in getting the "document sets" content types applied as expected when I try to create a site based off custom template.
Scenario:
We have 8 document sets stored in a document library. This library is part of a site which we have saved as a template.
E.g. of document sets is "Others", "Meetings" etc
Each of these document sets have one or more content types associated with it.
We are trying to create a site based off the saved site template using powershell.
E.g. $web = New-SPWeb http://myserver/sites/mysite/subsite
$web.ApplyWebTemplate("{GUID}#Name of Template")
When we open the document sets in this newly created site, the content types seem to be coming all together rather than being associated with the specific document set.
E.g. Clicking "New document" in the "others" document set would show up content types from "meeting" and all the remaining document sets present in that library.
Interestingly, when I go to "Document Set" settings, I only see the content type of "Others" Document Set.
Any idea why the "New document" dropdown for the document set is not behaving as expected?Hi Abhi,
Based on your description, I did a test. In my testing, everything worked well.
The steps are:
Go to Site Actions->Site Settings->Site content types.
Create a new content type, and select parent content type from Document Set Content Types, and Parent Content Type: Document Set
Click ok
Under Settings, click Document Set settings
On the Allowed Content Type section, select some content types and add them
Click OK
Then repeat step2-6, and create another custom document set
Open your library, and allow management of content types in advanced settings
Add the two document sets into the library
Check each document set, and each one had different content types
Save the site as a template and include the content
Create a new site based on the site template using PowerShell(the command was same with yours)
After creating, check the document sets of the library in the new site, everything worked well.
Please check your process as the above steps.
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support -
On Prem development machine, I'm writng a deployment routine in c# using the client object model. I've created some site columns of type Lookup, I've created a content type and added those lookup columns to it and I've created a list using the
content type. I want to set the RelationshipDeleteBehavior property on some of the lookup columns in the list. I'm also using the 16 assemblies.
List list = cc.Web.GetListByTitle("MyList");
cc.Load(list);
cc.ExecuteQuery();
Field f = list.Fields.GetByInternalNameOrTitle("MyLookupField");
cc.Load(f);
cc.ExecuteQuery();
(f
as
FieldLookup).RelationshipDeleteBehavior =
RelationshipDeleteBehaviorType.Restrict;
f is returning as a Field but (f
as
FieldLookup) is returning null here. Any insight on this?
Thank you.
Dan BudimirHi,
We can use SP.ClientContext.castTo method to convert the field to lookup field . The following code snippet for your reference:
ClientContext context = new ClientContext("http://siteurl");
NetworkCredential credentials = new NetworkCredential("username", "password", "domain");
context.Credentials = credentials;
Web web = context.Web;
List list = web.Lists.GetByTitle("MyList");
Field field = list.Fields.GetByInternalNameOrTitle("MyLookupField");
FieldLookup lookupField = context.CastTo<FieldLookup>(field);
lookupField.RelationshipDeleteBehavior = RelationshipDeleteBehaviorType.Restrict;
lookupField.Indexed = true;
lookupField.Update();
context.ExecuteQuery();
Thanks,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Dennis Guo
TechNet Community Support -
Incorrect Infopath content type update in form library after modifying Infopath form and publish it
I have an admin approved InfoPath form. I added new fields to that form and mapped those new fields with site columns. After uploading updated published form through CA, I noticed InfoPath Site content type for that form got updated (with newly added fields)
under Microsoft_Infopath group. This content type is also added in form library but somehow the new fields are updated incorrectly for this content type existing in form library (it doesn't show new fields, and shows one new field which is incorrectly
mapped with other column this is happening only in library).
Things I tried:
- Activate/Deactivate that content type feature
- Deactivated feature, removed form from CA, re uploaded and activated feature
- Removed those new fields and published and uploaded InfoPath form and then added those new fields and published and uploaded again.
-Deleted those fields from InfoPath and readded new fields and published and uploaded form but still the problem persists.
Any help will be appreciated.
Dhaval RavalHi Thanks for the response,
But Update all content types inheriting from this type is already checked.
That form library has multiple content types associated with it , different infopath forms get submitted there. What I noticed is that when I change the form and publish it, its corresponding site content type gets updated but the same content type used
in form library doesn't get updated properly. I went to form library and checked that erroneous content type, there were some columns missing and one column was mapped incorrectly. When I clicked on "Parent" content type, it was showing all the new Infopath
fields(updated content type). So I figured that Infopath site content type was getting updated correctly but it was not able to propagate those updates (in a correct way) to the form library. I also tried to edit that content type and tried adding existing
site columns which were missing but surprisingly it was not showing those site columns either, which were mapped from Infopath publishing.
The cause for this behavior is : changes/updates to the Infopath content type are not getting propagated to the form library and this is happening for only one infopath content type but other Infopath content types are getting updated.
I had to delete all the forms using that erroneous content type and then had to delete that content type from the library and then re-added that Infopath content type to the library and this time it was having correct content type (updated columns).
This is not a perfect solution for the production environment, sounds like it is a bug.
Dhaval Raval
Maybe you are looking for
-
Problems after playbook update
Hello blackberry users, I installed the new upgrade for the playbook last week and since then I have been running into the same problems; - extreme lag when playing games or surfing the web - playbook freezing on games/web/home screen - "Browser" n
-
My Nokia Asha 201 switches off right after I switch it on.. I was resetting my phone to factory settings and after that it wouldn't switch on anymore but instead it keeps flashing on the buttons. When I try to switch it on it shows NOKIA then it swit
-
How to do fast export and import
i have a windows 2003 server and oracle 10.2.0.3 installed on it. here i want to ask how i can speedup my export and import using expdp.
-
Search causes nokia maps to crash
Howdy, An oldie but a goodie here Maps (v3.09) on a nokia C7 worked fine until the last couple of weeks. Startup and positioning are OK. When I try to search for a destination though, the application crashes. Repeatedly. I can't think of anything I
-
Oh bloody hell where is the customer support
I am bloody annoyed I wrote a question for ******** customers support not this wazzerk any one know how you can contact these con mens actual staff what wazzerks? Anyone know how you can email these scum bags? All there is here is a link to a Russian