Jsp – How to post parameters for JSTL import tag ()


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 %>" />

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?

Best Solution

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.

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.

Related Question