Struts: Using Wildcards in ActionMapping

Discussion in 'Java' started by Josh Martin, Nov 20, 2003.

  1. Josh Martin

    Josh Martin Guest

    Struts Group -

    I've been banging my head against a wall for three days trying all
    kinds of things to get the ActionMapping wildcard feature to work.
    I'm receiving an error (listed below under THE ERROR), but it goes
    away if I remove the wildcard from the struts-config file (see SIMPLE
    CHANGE TO STRUTS-CONFIG.XML THAT MAKES IT WORK). I found a site with
    a JAR file that I also tried to use as a controller, but that didn't
    work either. Any help would be very appreciated!

    Josh


    STRUTS WILDCARD DOCUMENTATION
    http://jakarta.apache.org/struts/userGuide/building_controller.html#action_mapping_wildcards


    THE ERROR
    Cannot retrieve mapping for action /basicNavigateProduct


    SITE WITH A STRUTS CONTROLLER MEANT TO HANDLE WILDCARDS
    http://www.twdata.org/struts-wildcard/


    IN MY JSP
    <html:form name="productForm" type="com.gxs.lowes.forms.ProductForm"
    action="/basicNavigateProduct.do">


    THE STRUTS-CONFIG.XML
    <action-mappings>

    <action path="/*NavigateProduct"
    type="com.gxs.lowes.actions.NavigateProductAction"
    name="productForm"
    scope="session"
    input="{1}"
    validate="true">
    </action>

    </action-mappings>

    <controller processorClass="org.twdata.struts.WildcardTilesRequestProcessor"
    inputForward="true"/>;


    ALTERNATE STRUTS-CONFIG.XML CONTROLLER SETTINGS
    <controller inputForward="true"/>;


    SIMPLE CHANGE TO STRUTS-CONFIG.XML THAT MAKES IT WORK
    <action-mappings>

    <action path="/basicNavigateProduct"
    type="com.gxs.lowes.actions.NavigateProductAction"
    name="productForm"
    scope="session"
    input="basic"
    validate="true">
    </action>

    </action-mappings>

    <controller processorClass="org.twdata.struts.WildcardTilesRequestProcessor"
    inputForward="true"/>;
    Josh Martin, Nov 20, 2003
    #1
    1. Advertising

  2. Josh Martin

    Sudsy Guest

    Josh Martin wrote:
    > Struts Group -
    >
    > I've been banging my head against a wall for three days trying all
    > kinds of things to get the ActionMapping wildcard feature to work.
    > I'm receiving an error (listed below under THE ERROR), but it goes
    > away if I remove the wildcard from the struts-config file (see SIMPLE
    > CHANGE TO STRUTS-CONFIG.XML THAT MAKES IT WORK). I found a site with
    > a JAR file that I also tried to use as a controller, but that didn't
    > work either. Any help would be very appreciated!
    >
    > Josh


    I was unable to duplicate your problem in JBoss-3.2.2, which uses
    Tomcat 4.1. My attempts did confirm my concerns regarding Eclipse
    stability, however. At one point the auto-sync failed and after
    that I was unable to redeploy the application. Restarting Eclipse
    turned out to be the only solution.
    I also had to heed the warning about removing the stale servlets
    compiled from the JSPs.
    Could you post the precise error message? Server logs could help
    too...
    Sudsy, Nov 20, 2003
    #2
    1. Advertising

  3. Josh Martin

    Josh Martin Guest

    Sudsy -

    Thanks for your help. Here are the exceptions from the web page and
    the server log. I'm also posting the lines from basic_jsp.java (the
    compiled jsp) with line numbers. In your struts-config.xml, are you
    using a special controller, or are you using the default? I've tried
    both ways, but it doesn't work with either. Also, if I simply remove
    the wildcard, it works with both.

    Thanks,
    Josh


    ***** FROM THE WEB BROWSER *****

    HTTP Status 500 -

    --------------------------------------------------------------------------------

    type Exception report

    message

    description The server encountered an internal error () that prevented
    it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: Cannot retrieve mapping for action
    /basicNavigateProduct
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at com.gxs.lowespcm.util.compression.CompressionFilter.doFilter(CompressionFilter.java:214)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
    at java.lang.Thread.run(Thread.java:534)

    root cause

    javax.servlet.ServletException: Cannot retrieve mapping for action
    /basicNavigateProduct
    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)
    at org.apache.jsp.basic_jsp._jspService(basic_jsp.java:88)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at com.gxs.lowespcm.util.compression.CompressionFilter.doFilter(CompressionFilter.java:214)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
    at java.lang.Thread.run(Thread.java:534)

    --------------------------------------------------------------------------------

    Apache Tomcat/4.1.24-LE-jdk14





    ***** FROM THE SERVER LOG FILE *****

    org.apache.jasper.JasperException: Cannot retrieve mapping for action
    /basicNavigateProduct
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at com.gxs.lowespcm.util.compression.CompressionFilter.doFilter(CompressionFilter.java:214)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
    at java.lang.Thread.run(Thread.java:534)
    ----- Root Cause -----
    javax.servlet.ServletException: Cannot retrieve mapping for action
    /basicNavigateProduct
    at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)
    at org.apache.jsp.basic_jsp._jspService(basic_jsp.java:88)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at com.gxs.lowespcm.util.compression.CompressionFilter.doFilter(CompressionFilter.java:214)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
    at java.lang.Thread.run(Thread.java:534)





    ***** From basic_jsp.java *****

    61 try {
    62 _jspxFactory = JspFactory.getDefaultFactory();
    63 response.setContentType("text/html;charset=ISO-8859-1");
    64 pageContext = _jspxFactory.getPageContext(this, request,
    response,
    65 null, true, 8192, true);
    66 application = pageContext.getServletContext();
    67 config = pageContext.getServletConfig();
    68 session = pageContext.getSession();
    69 out = pageContext.getOut();
    70 _jspx_out = out;
    71
    72 out.write("\r\n");
    73 out.write("\r\n\r\n");
    74 out.write("\r\n");
    75 out.write("\r\n");
    76 out.write("\r\n");
    77 out.write("\r\n");
    78 out.write("\r\n");
    79 out.write("\r\n\r\n");
    80 Logger logger =
    Logger.getLogger("com.gxs.lowespcm.jsp.menu.jsp");
    81 out.write("\r\n\r\n");
    82 if (_jspx_meth_tiles_insert_0(pageContext))
    83 return;
    84 } catch (Throwable t) {
    85 out = _jspx_out;
    86 if (out != null && out.getBufferSize() != 0)
    87 out.clearBuffer();
    88 if (pageContext != null) pageContext.handlePageException(t);
    89 } finally {
    90 if (_jspxFactory != null)
    _jspxFactory.releasePageContext(pageContext);
    91 }
    92 }


    > Could you post the precise error message? Server logs could help
    > too...
    Josh Martin, Nov 21, 2003
    #3
  4. Josh Martin

    Sudsy Guest

    Josh Martin wrote:
    > Sudsy -
    >
    > Thanks for your help. Here are the exceptions from the web page and
    > the server log. I'm also posting the lines from basic_jsp.java (the
    > compiled jsp) with line numbers. In your struts-config.xml, are you
    > using a special controller, or are you using the default? I've tried
    > both ways, but it doesn't work with either. Also, if I simply remove
    > the wildcard, it works with both.
    >
    > Thanks,
    > Josh


    I copied the struts-wildcard-0.3.1.jar into the /lib directory for
    the application and used a controller processorClass of
    org.twdata.struts.WildcardRequestProcessor. Here's an extract from
    my $JBOSS_HOME/server/default/log/server.log file:

    2003-11-20 18:01:47,753 INFO
    [org.apache.struts.action.RequestProcessor] Processing a 'POST' for path
    '/YYWildcardDemo'
    2003-11-20 18:01:47,755 DEBUG [org.twdata.struts.ActionMappingMatcher]
    Time converting action mapping: 1 ms
    2003-11-20 18:01:47,755 DEBUG [org.apache.struts.util.RequestUtils]
    Looking for ActionForm bean instance in scope 'request' under attribute
    key 'WildcardForm'
    2003-11-20 18:01:47,756 DEBUG [org.apache.struts.util.RequestUtils]
    Creating new ActionForm instance of type 'com.myorg.WildcardForm'
    2003-11-20 18:01:47,756 DEBUG [org.apache.struts.util.RequestUtils] -->
    com.myorg.WildcardForm@1086036
    2003-11-20 18:01:47,758 DEBUG
    [org.apache.struts.action.RequestProcessor] Storing ActionForm bean
    instance in scope 'request' under attribute key 'WildcardForm'
    2003-11-20 18:01:47,759 DEBUG
    [org.apache.struts.action.RequestProcessor] Populating bean properties
    from this request
    2003-11-20 18:01:47,759 DEBUG
    [org.apache.struts.action.RequestProcessor] Validating input form
    properties
    2003-11-20 18:01:47,781 DEBUG
    [org.apache.struts.action.RequestProcessor] Validation failed,
    returning to '/WEB-INF/jsp/YY.jsp'
    2003-11-20 18:01:47,782 DEBUG
    [org.apache.struts.action.RequestProcessor] Delegating via forward to
    '/WEB-INF/jsp/YY.jsp'

    My post was to /YYWildcardDemo. The second line shows the conversion
    being performed by org.twdata.struts.ActionMappingMatcher. The
    remainder shows the appropriate processing with the final destination
    popping out at the bottom.

    Here's the form-bean and action from struts-config.xml:

    <form-beans>
    <form-bean
    name="WildcardForm"
    type="com.royalencore.WildcardForm"/>
    <form-beans>
    <action-mappings>
    <action
    path="/*WildcardDemo"
    type="com.myorg.WildcardAction"
    name="WildcardForm"
    scope="request"
    input="/WEB-INF/jsp/{1}.jsp"
    unknown="false"
    validate="true">
    <forward>
    name="continue"
    path="/wildcard.html"
    redirect="false"/>
    </action>
    </action-mappings>

    And here's the controller spec from the same file:

    <controller
    contentType="text/html;charset=UTF-8"
    nocache="true"
    maxFileSize="100K"
    processorClass="org.twdata.struts.WildcardRequestProcessor"/>

    In order to check for the correct processing of the {n} constructs
    in the file, I used the following source for com.myorg.WildcardForm:

    package com.myorg;

    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;

    public class WildcardForm extends ActionForm {

    public ActionErrors validate( ActionMapping req,
    HttpServletRequest resp ) {
    ActionErrors response = new ActionErrors();
    response.add( ActionErrors.GLOBAL_ERROR,
    new ActionError( "xxx" ) );
    return( response );
    }
    }
    Sudsy, Nov 21, 2003
    #4
  5. Josh Martin

    Josh Martin Guest

    Sudsy -

    Thank you for your help. I can get a non-Tiles example to run on my
    box now too. I'm still unable to make it work when a Tiles plugin is
    used, despite the claim at the original website.

    The bottom of my struts-config.xml looks nearly identical to the one
    that's working, minus the tiles plugin. Have you ever gotten your's
    to work in conjunction with Tiles. I promise this is my last question
    - I have to finish this up for a project, so some copying/pasting may
    occur despite valiant efforts!

    Josh

    <controller
    contentType="text/html;charset=UTF-8"
    nocache="true"
    maxFileSize="100K"
    processorClass="org.twdata.struts.WildcardTilesRequestProcessor"/>


    <!-- Message Resources -->

    <message-resources parameter="test.ApplicationResources"/>


    <!-- Required for Tiles. -->

    <plug-in className="org.apache.struts.tiles.TilesPlugin" >
    <set-property property="definitions-config"
    value="/WEB-INF/tiles-defs.xml" />
    <set-property property="moduleAware" value="true" />
    <set-property property="definitions-parser-validate" value="true"
    />
    </plug-in>








    Sudsy <> wrote in message

    > I copied the struts-wildcard-0.3.1.jar into the /lib directory for
    > the application and used a controller processorClass of
    > org.twdata.struts.WildcardRequestProcessor. Here's an extract from
    > my $JBOSS_HOME/server/default/log/server.log file:
    Josh Martin, Nov 22, 2003
    #5
  6. Josh Martin

    Sudsy Guest

    Josh Martin wrote:
    > Sudsy -
    >
    > Thank you for your help. I can get a non-Tiles example to run on my
    > box now too. I'm still unable to make it work when a Tiles plugin is
    > used, despite the claim at the original website.
    >
    > The bottom of my struts-config.xml looks nearly identical to the one
    > that's working, minus the tiles plugin. Have you ever gotten your's
    > to work in conjunction with Tiles. I promise this is my last question
    > - I have to finish this up for a project, so some copying/pasting may
    > occur despite valiant efforts!
    >
    > Josh


    Sorry, but before your post I'd never even found the need for wildcard
    matches! Trying to mix a mortar for Tiles...?
    Sounds like you're on your own with this one, although I'm heartened
    to hear that you got the rest of it working.
    Sudsy, Nov 22, 2003
    #6
  7. Josh Martin

    Josh Martin Guest

    Sudsy -

    Thanks again for all of your help! I never needed them either, but in
    this one, I have a major form loaded with data across a lot of pages,
    but wanted to validate (i.e. input=....) each page separately.
    Instead of copying/pasting the struts config, I just added a hidden
    property in the form that tells me that page they came from, and then
    call the validation from the action (versus letting Struts do it with
    the form itself). Seems to be working fine. Tiles is great - I have
    some relatively new programs, and I created a template with "DO NOT
    CHANGE ABOVE/BELOW THIS" comments, and now they can just use HTML and
    the Struts taglibs!

    Josh

    > Sorry, but before your post I'd never even found the need for wildcard
    > matches! Trying to mix a mortar for Tiles...?
    > Sounds like you're on your own with this one, although I'm heartened
    > to hear that you got the rest of it working.
    Josh Martin, Nov 23, 2003
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. philoso
    Replies:
    3
    Views:
    459
    James
    Jan 30, 2004
  2. Web learner
    Replies:
    0
    Views:
    736
    Web learner
    Apr 18, 2006
  3. Harlin Seritt

    Using wildcards...

    Harlin Seritt, May 2, 2005, in forum: Python
    Replies:
    4
    Views:
    356
    Harlin Seritt
    May 2, 2005
  4. Dipankar
    Replies:
    17
    Views:
    10,693
    Arne Vajhøj
    Aug 1, 2009
  5. William Hudspeth
    Replies:
    2
    Views:
    287
    Fabio FZero
    Mar 15, 2007
Loading...

Share This Page