0

Ok so I am trying to pass a java Set object that is being created in one JSP, lets call it jspA.jsp to another jsp, lets call it jspB.jsp. What I am about to attempt and hopefully will work is the following line of code:

<jsp: param name="setList" value="<%=setObject%>">

and on the other JSP i will just be using a getParameter("setList") call to retrieve the set. I was just wondering if there were any other suggestions to accomplishing this or would this be the best way to go about it?

djdgel
  • 61
  • 1
  • 4
  • The "best way" depends on the concrete functional requirement which is not entirely clear from your question. Please elaborate the functional requirement. At least, writing Java code in JSP is definitely not the "best way". Related: http://stackoverflow.com/questions/3177733/how-to-avoid-java-code-in-jsp-files – BalusC Feb 06 '12 at 16:39
  • @ Dave: Unfortunately everything that is done with my company is done inside JSPs :( It's kind of the one constraint i unfortunately have to abide by. I didn't think it'd work that way, was kind of hoping against logic lol. @ BalusC The functionality that I am trying to do is take a search page, and display the results on a separate page that is going to be a CSV list style. The problem is i need to pass, at the very least, a list of IDs to find all the files to the next JSP. Since the original search could be hundreds of files creating some sort of field isn't an option =/ – djdgel Feb 06 '12 at 16:49

1 Answers1

0

Doesn't work like that (and even if it did, as written, you're passing a string).

HTTP only passes strings around; keep it in session, or re-create.

(And don't do this is a JSP :(

Dave Newton
  • 158,873
  • 26
  • 254
  • 302