我正在为参数附加操作,但在我的 Struts 2 页面上出现异常。
PWC6212: equal symbol expected
下面是我要提交的附加参数代码的操作。
action="MyAction.action?id=<%=request.getParameter("id")%>&name=<%=request.getParameter("name")%>&age=<%=request.getParameter("age")%>&num=<%=request.getParameter("num")%>"
上面是不是语法问题?如果不是,那么我们如何将参数设置为带有操作的查询字符串?
最佳答案
您不应该使用 Scriptlet ( <%= %>
)
并且,如果 action
是 Struts 标签的一个属性(如 <s:form>
),你不能使用 scriptlet,你应该使用 OGNL
.
请引用这个问题:Struts 2 s:select tag dynamic id了解更多详情
关于java - 在 Struts 2 中附加带有操作的查询字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14644713/