[SalesForce] Open contact record in a new tab from visualforce page

I have created a visualforce page that displays a list of contacts associated with an opportunity. This is displayed in a section on the opportunity page layout. I need to open the contact record in a new tab.

<apex:page standardController="Opportunity" 
extensions="OpportunityApprenticeDetails_CX" tabStyle="Contact">
<apex:form >
<apex:pageBlock >
    <apex:pageBlockTable value="{!listContacts}" var="conts">

        <apex:column headerValue="First Name">
            <apex:commandLink value="{!conts.firstname}" target="_blank">
            <apex:param name="param1" value="{!conts.id}" assignTo="
            {!contact.id}"/>
            </apex:commandLink>
        </apex:column>
        <apex:column headerValue="LastName">
            <apex:outputField value="{!conts.lastname}"/>
        </apex:column>
        <apex:column value="{!conts.email}"/>
        <apex:column headerValue="Account Name">
            <apex:outputLink value="/{!conts.accountid}">
            {!conts.account.name}</apex:outputLink>
        </apex:column>


    </apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page> 

Best Answer

You can use like this way using apex:outputLink and in the value attribute specify URLFOR with the action and Id.

<apex:outputLink value="{!URLFOR($Action.Contact.View, conts.id)}" target="_blank">
        {!conts.firstname}
 </apex:outputLink>

Refer my blog post Different ways of navigation