LookupDispatchAction问题

发布于 2024-11-15 04:53:19 字数 2226 浏览 0 评论 0 原文

我对 LookupDispatchAction 类有疑问。

我在工作时遇到以下错误,

错误是:

javax.servlet.jsp.JspException: Servlet异常在 '/admin/custom-report.html?action=searchAttributes':您必须指定 value 属性 或嵌套标签内容

点击查看完整技术 此问题的详细信息:

Servlet异常 '/admin/custom-report.html?action=searchAttributes':您必须指定 value 属性 或嵌套标签内容 javax.servlet.jsp.JspException: Servlet异常在 '/admin/custom-report.html?action=searchAttributes':您必须指定 value 属性 或嵌套标签内容 org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:924) 在 org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:462) 在 _jsp._layout._providerLayout._jspService(_providerLayout.java:218) 在 com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:60) 在 oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416) 在 oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478) 在 oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:856) 在

和我的代码是

.jsp 文件(基于单选按钮选择,请求转发到 aciton 类):

<input type="hidden" name="action" value="<bean:message key="custom.report.go" />" id="act" />

我的操作类:

public class CustomReportAction extends LookupDispatchAction {

  protected Map getKeyMethodMap() 
  {
    Map map = new HashMap();
    map.put("custom.report.home", "home");
    map.put("custom.report.searchattributes", "searchAttributes");
    map.put("custom.report.go", "search");
    return map;
  }

  public ActionForward searchAttributes(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception 
  {
-----
---
} 

struts-config :

<action path="/admin/custom-report" type="org.springframework.web.struts.DelegatingActionProxy" name="CustomReportBean" parameter="action" scope="request" validate="false"> 
      <forward name="searchattributes" path="/jsp/report/customReportSearch.jsp"/>
      <forward name="search" path="customReport"/>
    </action>

请在这里帮助我,

提前致谢。

I have a problem regarding the LookupDispatchAction class.

The following error i am getting while working,

The error is:

javax.servlet.jsp.JspException:
ServletException in
'/admin/custom-report.html?action=searchAttributes': You must specify the value attribute
or nested tag content

Click to view the complete technical
details of this problem:

ServletException in
'/admin/custom-report.html?action=searchAttributes': You must specify the value attribute
or nested tag content
javax.servlet.jsp.JspException:
ServletException in
'/admin/custom-report.html?action=searchAttributes': You must specify the value attribute
or nested tag content at
org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:924)
at
org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:462)
at
_jsp._layout._providerLayout._jspService(_providerLayout.java:218)
at
com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:60)
at
oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)
at
oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
at
oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at

and My code is

.jsp file (based on radio button selection the request forwarded to aciton class):

<input type="hidden" name="action" value="<bean:message key="custom.report.go" />" id="act" />

my action class:

public class CustomReportAction extends LookupDispatchAction {

  protected Map getKeyMethodMap() 
  {
    Map map = new HashMap();
    map.put("custom.report.home", "home");
    map.put("custom.report.searchattributes", "searchAttributes");
    map.put("custom.report.go", "search");
    return map;
  }

  public ActionForward searchAttributes(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception 
  {
-----
---
} 

struts-config :

<action path="/admin/custom-report" type="org.springframework.web.struts.DelegatingActionProxy" name="CustomReportBean" parameter="action" scope="request" validate="false"> 
      <forward name="searchattributes" path="/jsp/report/customReportSearch.jsp"/>
      <forward name="search" path="customReport"/>
    </action>

please help me here

thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

孤寂小茶 2024-11-22 04:53:19

我认为错误的原因是语法错误

您在 之前打开双引号,并在 key= 之后关闭双引号。
要使用嵌套引号,您必须对其进行转义或对嵌套表达式使用单个引号。

<input type="hidden" name="action" value="<bean:message key=\"custom.report.go\" />" id="act" />

或者

<input type="hidden" name="action" value="<bean:message key='custom.report.go' />" id="act" />

I suppose the reason of your error is a wrong syntax

You open double quotes before <bean:message and close it after key=.
For using nested quotes you have to escape it or use a single one for a nested expression.

<input type="hidden" name="action" value="<bean:message key=\"custom.report.go\" />" id="act" />

or

<input type="hidden" name="action" value="<bean:message key='custom.report.go' />" id="act" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文