将值从servlet传递给html [英] Passing value from servlet to html

查看:132
本文介绍了将值从servlet传递给html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个servlet处理网络中的一些内容并生成一个String值。我需要在表格标签内的HTML页面中显示此字符串值。



如何使用setAttribute方法和getrequestdispatcher方法从servlet传递此字符串值?



感谢您
Abhishek S

解决方案

从servlet到JSP(而不是HTML)使用请求转发,并通过在请求中将数据设置为属性,然后在JSP上,您可以呈现这些数据以生成HTML




请参阅


I have a servlet that processes some content from the web and generates a String value. I need to display this String value in a html page within a table tag.

How do I pass this string value from servlet using the setAttribute method and getrequestdispatcher method?

Thanks Abhishek S

解决方案

You can pass the data from servlet to JSP (not HTML) using request forward and by setting data as attribute in request and then on JSP you can render those data to generate HTML


See

这篇关于将值从servlet传递给html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆