<s:form action="<%=request.getContextPath()%>/test/list.action"></s:form>
上面这个报错:
index.jsp(42,23) attribute for %>" is not properly terminated
但是下面这个没错,为什么啊,郁闷
<form action="<%=request.getContextPath()%>/control/method/list.action">
web.xml配置  <filter>
   <filter-name>struts2</filter-name>
   <filter-class>
   org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
   </filter-class>
  </filter>
  <filter-mapping>
   <filter-name>struts2</filter-name>
   <url-pattern>/*</url-pattern>
  </filter-mapping>

解决方案 »

  1.   

    <s:form action="<%=request.getContextPath()%>/test/list.action"></s:form>
    应不是这问题 你把代码全帖出来看看
      

  2.   


    当前页面是不需要request.getContextPath;因为request.getContextPath返回的就是这个页面的相对根目录。struts标签中不可以嵌套jsp表达式,只接受 ${}或是%{}形式的表达式;要在struts标签中访问request\session,可以使用 <s:property value="#request"/>\<s:property value="#session"/>
      

  3.   

    s:form中action的属性直接指定action的name就可以,然后指定namespace, struts2会自动帮你完成这个路径的.! 不用像你拼的那么费劲!
    例如  你现在是test/list.action 那么 你可以直接写
    <s:form action="list" namespace="/test">这样!
      

  4.   

    不要把s:form当成普通的html form用