简体   繁体   English

如何通过单击事件处理jsp taglib?

[英]how can i handle the jsp taglib by clicking event?

i have a form with one text input and submit button i wanna my taglib is run when submit button clicked my taglib save the textbox value in a dataBase 我有一个带有一个文本输入和提交按钮的表单,我想在单击提交按钮时运行我的taglib我的taglib将文本框值保存在数据库中

i wtote below code but not run: 我写下面的代码,但不能运行:

<form action="some page">

<input type="text" name="t1">
<input type="submit" oncick="<mytaglibName1: mytaglibNmae2> >

</form>

If I understand the question correctly you don't want JSP tags to store values, you want to return the form to a Servlet and then do the database storage in there... 如果我正确地理解了这个问题,那么您不想让JSP标记存储值,则想将表单返回到Servlet,然后在其中进行数据库存储...

<form action="servlets/StoreValue">

<input type="text" name="t1">
<input type="submit">

</form>

then in your Servlet you'd do the database storage. 然后在Servlet中进行数据库存储。 When your JSP page is returned to the web browser it doesn't contain any JSP tags, all the browser sees is HTML, you you have to submit the form back to the web server to do the processing. 当您的JSP页面返回到Web浏览器时,它不包含任何JSP标记,浏览器看到的只是HTML,您必须将表单提交回Web服务器以进行处理。

I may of totally misunderstood the question in which case my apologies. 在这种情况下,我可能会完全误解了我的道歉。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM