java - hide passed parameter from jsp to struts2 action class -
<s:url action="someaction" var="act"> <s:param name="param1">value1</s:param> </s:url> <s:a href="%{act}">go action</s:a>
by clicking go action link, address www.example.com/someaction?param1=value1
want hide passed parameters (param1=value1) method="post" in submitting of form. there anyway can it? thanks.
to hide passed parameter need submit form. should prevent default behavior of click event , replace form event. in example
<s:form id="f1" action="someaction"> <s:hidden name="param1" value="value1"/> <s:url action="someaction" var="act"/> <s:a id="a1" href="%{act}">go action</s:a> <script type="text/javascript"> $(document).ready(function() { $("#a1").click(function(event) { event.preventdefault(); $("#f1").submit(); }); }); </script> </s:form>
Comments
Post a Comment