I am new to web development. Can somebody advise me on how I can pass an ArrayList from my JSP to action class.

I have the following link in my JSP which links to an action class.

<li> <A href="inboxMsg.do">Link to action</A></li>

Can I pass the arraylist in the above code?

Is using <html:link> a better option instead of the above code?

Thanks for suggestions.

Why do you want to pass an array list to your action class? didn't it come from the server in the first place?

Why do you want to pass an array list to your action class? didn't it come from the server in the first place?

Basically I am displaying a list of messages in my JSP. When user clicks on one of the message I want to send the list to an action class for further processing and then the action class redirects it to a JSP.

The reason I ask is that there are methods for sending information from the JSP to the server (Forms).

If you want that information to be an ArrayList, then you have to store it in the session on the server. This is silly. Limit what you save in the session to the minimum and limit the data you need to transfer to the minimum (obviously compromises need to be made).

But you can send the messages back in a Form submit. If you need to. Or you can keep the messages on the server. If you need to.

Hi,

I'm also new to Java world and in need of help for the same scenario.

Did you get this resolved? If so, can you pls. share the logic/code snippet.

Thank you.

This article has been dead for over six months. Start a new discussion instead.