i want call servlet when radio button clicked, how can make it?
edit
i tried add url servlet in javascript function this
$.post( "parentmanagementservlet", "isactivated");
and this
$.post(<%=getservletcontext().getcontextpath()+"/parentmanagementservlet"%>, "isactivated");
and
$.post("/parentmanagementservlet?isactivated=true");
but both not call servlet!
here's url mapping of servlet in web.xml
<servlet> <servlet-name>parentmanagementservlet</servlet-name> <servlet-class>ps.iugaza.onlineinfosys.servlets.parentmanagementservlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>parentmanagementservlet</servlet-name> <url-pattern>/parentmanagementservlet</url-pattern> </servlet-mapping>
i add servlet through name, read it's better servlet absolute path form servlet context.
as per comments:
about firebug, here's returns $ not defined
the $
definied jquery. you've apparently not declared in page. jquery js library , not builtin browser or something.
put following line before other <script>
in <head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
(you can of course download , serve copy own domain)
<script src="jquery-1.5.2.min.js"></script>
see also:
- update current page servlet - contains several complete jquery-servlet examples
Comments
Post a Comment