MyException - 我的异常网
当前位置:我的异常网» Eclipse » <html:link用<bean:write name="element

<html:link用<bean:write name="element"/>做参数有关问题(3)

www.MyException.Cn  网友分享于:2013-12-29  浏览:56次

                                        </TR>
                              </logic:iterate>
                              </TABLE>
                          </TD>
                      </TR>
                </TABLE>

  问题一: <html:link   action= "/http2?method=delete&college= ' <bean:write   name= "element "/> ' "> delete </html:link> 要用 <bean:write   name= "element "/> 作为参数,但按上面这样写时页面提示错误,请问有没有能正确的途径让college的值为bean的属性值,

struts-config.xml配置文件如下
<?xml   version= "1.0 "   encoding= "UTF-8 "?>
<!DOCTYPE   struts-config   PUBLIC   "-//Apache   Software   Foundation//DTD   Struts   Configuration   1.1//EN "   "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd ">
<struts-config>
      <data-sources   />
      <form-beans   >
            <form-bean   name= "http2Form "   type= "com.yourcompany.struts.form.Http2Form "   />

      </form-beans>

      <global-exceptions   />
      <global-forwards   >
            <forward   name= "add "   path= "/form/add.jsp "   />
            <forward   name= "delete "   path= "/form/delete.jsp "   />
            <forward   name= "modify "   path= "/form/modify.jsp "   />

      </global-forwards>

      <action-mappings   >
            <action
            attribute= "http2Form "
                  input= "/form/http2.jsp "
                  name= "http2Form "
                  path= "/http2 "
                  parameter= "method "
                  scope= "request "
                  type= "com.yourcompany.struts.action.Http2Action "   />

      </action-mappings>

      <message-resources   parameter= "com.yourcompany.struts.ApplicationResources "   />
</struts-config>

问题二:将上面的 <html:link     改写为 <a   href= "/http2?method=delete&college= <bean   write   name= "element "/> "> delete </a>
提交后不执行DispatchAction的delete方法,而连接到其他页面了,
请问是什么原因啊?

//Created   by   MyEclipse   Struts
//   XSL   source   (default):   platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.8.3/xslt/JavaClass.xsl

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有