Ahmad MOUSSA
Ahmad MOUSSA

Reputation: 2926

How to pass dynamic parameter value in a link using Struts taglib?

I'm trying to use Struts framework in my project. I want to use the html:button to send parameter in the link but I don't understand how to make it.

In other words, I want to translate this line:

<input type="button" onClick="window.location.href='resum.do?action=ViewMessage&&id_message=<%= id_msg %>'" value="View"/>

to Struts taglib, something like this:

<html:button property="" onclick="window.location.href='resum.do?action=ViewMessage&&id_message=<%= id_msg %>'" value="View"></html:button>

But it didn't work.

Upvotes: 1

Views: 1040

Answers (1)

Roman C
Roman C

Reputation: 1

The html:button tag is used only inside the form tag. See the docs

This tag is only valid when nested inside a form tag body.

Also set the property attribute.

Upvotes: 1

Related Questions