Q:

how to get the value of visualforce component into apex controller

I would like to access the Visualforce page component value into apex controller. I have tried it but not able to achieve can anyone tell.

A:

You can do something like below in the VF page
<apex:param name="test" value="XYZ" assingTo={!valForController}/>

and the controller code will be like 
public string valForController {get;set;}

