开发者

getting values from servlet to same html page

开发者 https://www.devze.com 2023-03-02 17:37 出处:网络
I have created 3 textboxes in HTML page and I gave 2 values for first two text boxes and send to a servlet and I want 开发者_如何转开发get result back in third text box. How can I do this?You need to

I have created 3 textboxes in HTML page and I gave 2 values for first two text boxes and send to a servlet and I want 开发者_如何转开发get result back in third text box. How can I do this?


You need to use JSP. Forward request from servlet to jsp setting daat in attribute.

in Servlet

request.setAttribute("attrName","Value");

now forward this request to jsp, and on jsp access this attrName with

${attrName}

See

  • Servlets


You can use JSP or AJAX,JavaScript to send the request to the servlet and receive the response to update the third textbox...

0

精彩评论

暂无评论...
验证码 换一张
取 消