I don't think we can access the
java variables directly inside the javascript.
However you can try out the following....
(1) Create a hidden variable
<html:hidden property="getcontext" value="<%=request.getContextPath()%>"/>
(2) Access the same using the document object
var param = document.formName.getcontext.value; //don't use String here. Use var as datatype.
Regards,
Kiran.