Search code examples
javajspstruts2jstlognl

How to use getParameter() in Struts 2 tag?


I want to get a variable that I search in JSP, something like this

<s:textfield value="<%=request.getParameter("id")%>" /> 

How to use getParameter() in Struts 2 tag?


Solution

  • Try

    <s:textfield  value="%{#parameters.id}" />
    

    scriptlets as well as JSTL EL not allowed in struts tags attributes. Use OGNL.