function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sphoidsphoid 

end tag name </HEAD> must be the same as start tag <META>

I'm fairly new to apex/visual force and I'm having a strange error that I am unsure how to troubleshoot.

 

I have a form in visualforce

    <apex:page controller="SyncController">
<apex:sectionHeader title="Manual Export" subtitle="Manually export contacts and/or leads to your Postal mailing lists"/>

<apex:pageMessages />

<apex:form id="exportForm">

<apex:pageBlock title="List Settings">

<label>List Name</label> <apex:inputtext id="listName" required="true"/><br/>

</apex:pageBlock>

<apex:pageBlock title="Export Type">

<apex:selectRadio id="exportType" value="{!exportType}" required="true">
<apex:selectOptions value="{!exportTypes}"/>
</apex:selectRadio>


</apex:pageBlock>

<apex:commandButton action="{!manualExport}" value="Export" />
</apex:form>

</apex:page>

And my controller looks like this:

public with sharing class SyncController {

	public String exportType {get;set;}
	public String listName {get;set;}
	
	public PostalAccount__c account;
		
	public Integer contactsExported = 0;
	public Integer leadsExported = 0;
			
	public SyncController(){
		this.account = PostalAccount__c.getInstance();
		if (this.account == null){			
			ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR, 'You must configure your Postal Account settings before you can export'));			
		}
	}
	
	public Boolean exportReady{
		get {
			if (this.account == null)
				return false;
			else
				return true;
		}
	}
			
	public List exportTypes{
		get {
			List exportTypes = new List();
			exportTypes.add(new SelectOption('C', 'Contacts'));
			exportTypes.add(new SelectOption('L', 'Leads'));
			exportTypes.add(new SelectOption('LC', 'Leads and Contacts'));
			return exportTypes;
		}
	}

	public PageReference manualExport(){
		this.exportType = ApexPages.currentPage().getParameters().get('exportType');
		this.listName = ApexPages.currentPage().getParameters().get('listName');
		
		PostalExporter exporter = new PostalExporter(this.account.Postal_Domain__c, this.account.Postal_User__c, this.account.Postal_Password__c);
		Boolean result;
		
		if (this.exportType.compareTo('C') == 0){
			result = exporter.exportContacts();
			if (result){
				ApexPages.addMessage(new ApexPages.message(ApexPages.Severity.INFO, 'Exported ' + exporter.contactsExported + ' Contacts'));
			}
		} else if (this.exportType.compareTo('L') == 0){
			result = exporter.exportLeads();
			if (result){
				ApexPages.addMessage(new ApexPages.message(ApexPages.Severity.INFO, 'Exported ' + exporter.leadsExported + ' Leads'));
			}
		} else if (this.exportType.compareTo('LC') == 0){
			result = exporter.exportAll();
			if (result){
				ApexPages.addMessage(new ApexPages.message(ApexPages.Severity.INFO, 'Exported ' + exporter.contactsExported + ' Contacts'));
				ApexPages.addMessage(new ApexPages.message(ApexPages.Severity.INFO, 'Exported ' + exporter.leadsExported + ' Leads'));
			}
		} else {
			ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR, 'Invalid export type'));
			result = false;
		}
		
		if (result == false)
			ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR, 'Export failed'));
				
		return null;
	}
	
}

Since i'm in the preliminary stages of development my exporter class does nothing but return true or false for now so all i want to happen is to go back to the form and just show some debug statements. The problem is I am getting a very cryptic error when i submit the form:

end tag name </HEAD> must be the same as start tag <META> from line 2 (position: TEXT seen ...:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>\n</HEAD>... @5:8) 

I am stumped so any insight would be appreciated. thanks.

Best Answer chosen by Admin (Salesforce Developers) 
sphoidsphoid

Thanks for the response. I finally figured it out (that always happens when i post on forums). The problem was with an outgoing HttpRequest i was making to a domain that was not accessible from the salesforce servers. The error was from trying to parse the failed response as xml. I was able to better troubleshoot it once i started getting stack traces in my dev accout, the error itself was no help. Thanks again.

All Answers

imuinoimuino

I think there must be some problem with the apex:sectionHeader tag try to comment that and see if it works

Thanks

sphoidsphoid

Thanks for the response. I finally figured it out (that always happens when i post on forums). The problem was with an outgoing HttpRequest i was making to a domain that was not accessible from the salesforce servers. The error was from trying to parse the failed response as xml. I was able to better troubleshoot it once i started getting stack traces in my dev accout, the error itself was no help. Thanks again.

This was selected as the best answer