通过struts2传递参数的问题<;s:url/>;

通过struts2传递参数的问题<;s:url/>;,struts2,dynamic-image-generation,Struts2,Dynamic Image Generation,我通过从动态图像url传递参数来调用struts2操作 “/> 通过此操作,我的操作可以正确调用,但是参数imageId=logo.jpg没有传递到我的操作类 但如果我手动从浏览器url传递参数,则参数将正确显示在我的java页面中,例如http://localhost:8080/mypoject/jspHomepage/bookstransaction/secure/ImageAction?imageId=logo.jpg 这可能是什么原因? 请帮帮我 struts.xml

我通过从动态图像url传递参数来调用struts2操作

“/>

通过此操作,我的操作可以正确调用,但是参数
imageId=logo.jpg
没有传递到我的操作类

但如果我手动从浏览器url传递参数,则参数将正确显示在我的java页面中,例如
http://localhost:8080/mypoject/jspHomepage/bookstransaction/secure/ImageAction?imageId=logo.jpg

这可能是什么原因? 请帮帮我

struts.xml

          `
    `<package name="Image"   extends="struts-default,json-default"> 
            <result-types>
        <result-type name="imageResult"
            class="v.esoft.actions.changetheme.CustomImageBytesResult" />
        </result-types>
          <action name="updatethemeimageform"  class="v.esoft.actions.changetheme.ThemedetailsEditAction" method="updateThemesImage">  
            <result name="success" type="json"/>
            <result name="input" type="json"/>     
        </action>  
       <action name="Display" class="v.esoft.actions.changetheme.DisplayAction">
            <result name="success" type="json"/>
      </action> 
      <action name="ImageAction" class="v.esoft.actions.changetheme.ImageAction">
        <result name="success" type="imageResult">
        </result>
     </action> 
         </package>`
以下内容未经测试

使用参数标记添加参数

<s:url package="Image" action="ImageAction" var="myUrl">
   <s:parm name="imageId" value="'logo.jpg'"/>
</s:url>

<img src="<s:property value="#myUrl"/>"/>

"/>

注意:我怀疑在最后一行myUrl应该足够了(没有#),但现在不记得了

如何检查
imageId
是否已设置?@AleksandrM什么意思?@AleksandrM我确信问题出在
上,因为我的参数没有发送到我的操作类
你怎么知道的?你试过在action方法内部打印它吗?@AleksandrM是的,我试过打印它
System.out.println(“imageId”+imageId)但它将为空。。即使我右键单击jsp页面上的空img标记,即(
“/>
)并在新浏览器选项卡中打开它,它也只会给我操作名而不给参数名。即(
http://localhost:8080/projectName/ImageAction
<s:url package="Image" action="ImageAction" var="myUrl">
   <s:parm name="imageId" value="'logo.jpg'"/>
</s:url>

<img src="<s:property value="#myUrl"/>"/>