简体   繁体   中英

want to append URL as well as want to submit the form with Get request of HTML

In my JSP Page i have one tag .the URL of this tag i am setting in java script which calls servlet.so basically all the parameters are passing by GET request.

The above wroks fine as it generates pdf of current form data so in URL user can see all parameters.

Now the problem is that i have added one more parameter for sending to servlet get request which is quite a long.so it gives error."TOO LONG URI REQUEST".the data which i am seding is javascript variable.

I can not change it to post as i want some data also to be passed in URL.and the parameter which i am adding(the large one) can be by hidden variable or so..???

so can you suggest what should i do??

 <div class="pdflink">
 <a id="pdfLinkForGroup" href="" onclick="getPDF('<%=reportID%>','',reportTitle)"> <img src="/images/PdfIcon.jpg" class="pdflink"></img></a></div>

getPDFfunction:

aTag=document.getElementById("pdfLinkForSingle");
var queryString = "?"+qry+qString+"&offset=" + offset + "&limit=1000"+"&imgwidth="+imgWidth+"&imgheight="+imgHeight+lastorderby+lastordertype+"&path=/tmp/pdf.xml&svgData="+encodeURIComponent(svgData);
var url = conPath+"/pdf/"+encodeURIComponent(reportName)+".pdf" + queryString + searchQuery;
aTag.target="blank";
aTag.href=url;

It is because DOS is enabled on the sever. Try increasing the MAX URI REQUEST SIZE value in server DOS configuration.

I think you could found an answer in the following URL which is talking about the max URL length you can put in your browser.

The issue seems that you put a long URL, and there are 2 solutions: - modify you parameters in the url, minify them! - Use POST to send the parameters to your server

What is the maximum length of a URL in different browsers?

Enjoy :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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