如何发布JSTL导入标记(< c:import>)的参数? [英] How can I post parameters for JSTL import tag (<c:import>)?

查看:147
本文介绍了如何发布JSTL导入标记(< c:import>)的参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在JSP页面中使用JSTL标记来导入外部页面的内容:

I'm currently using JSTL tag in a JSP page to import the content of an external page:

<c:import url="http://some.url.com/">
   <c:param name="Param1" value="<%= param1 %>" />
   ...
   <c:param name="LongParam1" value="<%= longParam1 %>" />
</c:import>

不幸的是,参数现在变长了.由于它们在URL中被编码为 GET 参数,因此我现在收到"414:Request-URL too Large"错误.有没有办法将参数 POST 到外部URL?也许使用其他标签/标签库?

Unfortunately the parameters are now getting longer. Since they are encoded as GET parameters in the URL, I am now getting "414: Request-URL too Large" error. Is there a way to POST the parameters to the external URL? Maybe using a different tag / tag library?

推荐答案

通过 http://www.docjar.com/html/api/org/apache/taglibs/standard/tag/el/core/ImportTag.java.html ,我得出的结论是您无法进行POST.使用import标记请求.

After looking thru http://www.docjar.com/html/api/org/apache/taglibs/standard/tag/common/core/ImportSupport.java.html and http://www.docjar.com/html/api/org/apache/taglibs/standard/tag/el/core/ImportTag.java.html , i ve come to the conclusion that you cannot do a POST request using the import tag.

我想您唯一的选择就是使用自定义标签-编写一个带有一些POST参数并输出响应文本的apache httpclient标签应该很容易.

I guess the only choice you have is to use a custom tag - it should be pretty easy to write an apache httpclient tag that takes some POST param and output the response text.

这篇关于如何发布JSTL导入标记(&lt; c:import&gt;)的参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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