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.

Recommended Answers

All 4 Replies

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.