, , JSF - HTTP-, java.net.URLConnection Apache HttpComponents Client, ?
GET , HTTP- ( , JSESSIONID cookie) . HTTP- Set-Cookie GET, JSESSIONID Cookie POST. HTTP- , JSF "View Expired", - JSF HTTP 500 ViewExpiredException, - JSF .
JSF- CSRF, javax.faces.ViewState, GET. , name=value , , .
, GET HTML-
<form id="sampleForm" name="sampleForm" method="post" action="/pages/main/main.smnet" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="sampleForm" value="sampleForm" />
<input id="sampleForm:sampleButton" type="submit" name="sampleForm:sampleButton" value="ok" />
<input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id65" autocomplete="off" />
</form>
(Jsoup ) :
sampleForm=sampleFormsampleForm:sampleButton=okjavax.faces.ViewState=j_id65
, POST /pages/main/main.smnet ( JSESSIONID cookie!). , , () JSF- , . id="sampleButton" <h:commandButton>, JSF , sampleForm:j_id42. , , HTML-.
, / , API - . - Java EE, JSF HTML, JAX-RS REST.
. :