Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

HTML onclick, session.setAttribute and jsp:forward

843836Jul 1 2004 — edited Jul 1 2004
Hi,

I've been trying to create a button/link that would forward to a new page with a few objects that I would like to pass along.

I have tried this:
<INPUT TYPE="IMG" SRC="next.gif" ONCLICK="session.setAttribute(\"attr1\",attr1); session.setAttribute(\"attr2\",attr2);<jsp:forward page='nextpage.jsp'>">
I manage to get the the next page, the nextpage.jsp being displayed in the browser addressbar, but I keep getting a NullPointer thrown back by Sun Applcation Server 8.

I have even tried using <%! %> to declare a method within the jsp to setAttributes, and tried using <FORM> tags with the action "submitform()" to no avail.

I need this done, as the intention is to have a column of buttons for a table, where a list is displayed. Upon clicking the button, the user will be provided with the details of the specific item.

Please help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 29 2004
Added on Jul 1 2004
1 comment
1,156 views