A
A
andy-0072014-08-28 10:56:28
Java
andy-007, 2014-08-28 10:56:28

How to pass a parameter to an Action?

You can pass a parameter to an Action like this:
<s:form action="index?pageLevel=99">
But you need to pass it dynamically, for example,
<s:form action="index?pageLevel=<%=level%>">
or

<c:set var="pageLevel" scope="page" value="<%=level%>" />
<s:form action="index?pageLevel=${pageLevel}">

But it doesn't work. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Elena, 2014-08-28
@Nidora

If you need to transfer parameters dynamically without writing them in struts-config.xml, then this can be done differently, for example, put them in request.
get it like that

String contractNo = (String)request.getAttribute ("contractNo");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question