For those reading this thread and wanting to know more about Sightly - there are 2 good community articles on Sighty - here is one that shows how to use Sightly with Java in back end:
https://helpx.adobe.com/experience-manager/using/creating-sightly-component.html
See this new AEM Community article that uses Java, Slighty and Sling Models to build a component that is able to parse a DOM.
https://helpx.adobe.com/experience-manager/using/domparser.html
In this example - values that an author enters into a component dialog are passed to the Java back end - such as the URL of the web page to parse.
In addition to these articles - we have this really good web presentation by Feike:
https://www.youtube.com/watch?v=QfvFWSQQ_0M
If you want to pass values from a web page (as opposed to a component dialog that an author enters during design time on the Author instance) - I would look at using AJAX to post values to a servlet. Most Sightly components - the values passed to Java are entered into a component dialog.