Controller:
Public with sharing class Sample { Public string myInput{get;set;} Public string myOutput{get;set;} Public void myMethod(){ myOutput = myInput; } }
Visualforce Page:
<apex:page controller="Sample"> <!--Pass parameters from visualforce page to controller--> <apex:form> <apex:pageblock > Input Here - <apex:inputText value="{!myInput}"/> <apex:commandButton value="Submit" reRender="outputID" action="{!MyMethod}"/> </apex:pageblock> <apex:pageblock > <b>Output Here - </b><apex:outputText value="{!myOutput}" id="outputID"> </apex:outputText> </apex:pageblock> </apex:form> </apex:page>