I have a very huge json string that i'm trying to pass from one jsp to another through a hidden form method. But when i receive it in my other jsp only half the string appears, i do know it is very large. My results.jsp has different ids and on clicking any one of them it goes to details.jsp, which is passed both the id clicked and the whole string through a hidden form. I think POST method has a limit on the size passed and thus my whole string is not sent.
results.jsp
<head>
<script type="text/javascript">
function submitHiddenForm(Key) {
document.getElementById("Key").value = Key;
document.myForm.submit();
}
</script>
</head>
<body>
<div class="list-group">
<%
List<ComparisonResultDTOarr> ls = diff.getComparisonResultDTOarr();
for(int i = 0;i<ls.size();i++)
{
List<AuditItemLogsDTOArr> lsinner = ls.get(i).getAuditItemLogsDTOArr();
%><a href="#" onclick="submitHiddenForm('<%=lsinner.get(0).getKeyAsString()%>')" class="list-group-item">
<%out.println(lsinner.get(0).getKeyAsString());%></a><%
}
%>
</div>
<form action="details.jsp" method="post" name="myForm">
<input type="hidden" name="Key" id="Key"><br>
<input type="hidden" name="jsonString" id="jsonString" value=<%=(String)request.getAttribute("jsonstring") %>>
</form>
</body>
and in my details.jsp i am simply getting the parameters
<%
String Key = request.getParameter("Key");
String jsonstr = (String)request.getParameter("jsonString");
%>
and displaying the jsonstr in a paragraph:
<p><%=jsonstr %></p>
but its incomplete and only displays partially. I know this is a bit confusing so please let me know if you need any more details.
P.S - I cannot use dispatcher as it needs to be onclick of the ID.