如何将链接中的值传递给serlvet中的函数

Debian 2003-05-26 03:13:39
链接如下所示:
<a>
<xsl:attribute name="href">
/examples/servlet/delete?id=<xsl:value-of select="position()"/>
</xsl:attribute>
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
delete
</a>
函数:
delete(String id)
如何在点击链接的时候将id的值传递给delete函数,谢谢!
...全文
48 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Aeonsun 2003-05-26
  • 打赏
  • 举报
回复
前台已经有了,我就不说了.
servlet中

ServletContext context = this.getServletConfig().getServletContext();
String id = context.getInitParameter("id");
然后就直接用吧
zhaoxichao 2003-05-26
  • 打赏
  • 举报
回复
<a >
<xsl:attribute name="href">
/examples/servlet/delete?id=<xsl:value-of select="position()"/>
</xsl:attribute>
<xsl:attribute name="onclick">delete(<xsl:value-of select="@id"/>)</xsl:attribute>
</a>
dustwoo 2003-05-26
  • 打赏
  • 举报
回复
getParameter("id") 行吗?
Debian 2003-05-26
  • 打赏
  • 举报
回复
各位,帮个忙吧。
在线等待。

81,115

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧