1. JSP中要引用webwork的标签库,需要这么写,下面的不能写错,我出现了将uri="webwork"的情况,报找不到/WEB-INF/pages/webwork的错误。
[code]<%@taglib prefix="ww" uri="/webwork" %>[/code]
2. 写Model的时候,如果页面中增加了name的标签,比如说
[code]<input type="submit" value="submit" name="B1"/>
<input type="reset" value="reset" name="B2"/>[/code]
的时候也会出问题,报在Model中找不到B1,B2的错误。
3. xwork.xml是配置Action以及跳转的。
[code]<action name="login" class="com.wzg.metrics.LoginAction">
<result name="success" type="dispatcher">
<param name="location">/WEB-INF/pages/login-Success.jsp</param>
</result>
<result name="loginFail" type="dispatcher">
<param name="location">/index.jsp</param>
</result>
<interceptor-ref name="params"></interceptor-ref>
<interceptor-ref name="model-driven"></interceptor-ref>
</action>[/code]
这里的action不要写成<action name="/login">,那么在执行的时候它的URL是http://localhost:8080/login,这样肯定就错了,缺少了具体的应用的地址部分。
[code]<%@taglib prefix="ww" uri="/webwork" %>[/code]
2. 写Model的时候,如果页面中增加了name的标签,比如说
[code]<input type="submit" value="submit" name="B1"/>
<input type="reset" value="reset" name="B2"/>[/code]
的时候也会出问题,报在Model中找不到B1,B2的错误。
3. xwork.xml是配置Action以及跳转的。
[code]<action name="login" class="com.wzg.metrics.LoginAction">
<result name="success" type="dispatcher">
<param name="location">/WEB-INF/pages/login-Success.jsp</param>
</result>
<result name="loginFail" type="dispatcher">
<param name="location">/index.jsp</param>
</result>
<interceptor-ref name="params"></interceptor-ref>
<interceptor-ref name="model-driven"></interceptor-ref>
</action>[/code]
这里的action不要写成<action name="/login">,那么在执行的时候它的URL是http://localhost:8080/login,这样肯定就错了,缺少了具体的应用的地址部分。