Dear all,

I am a bit confused about generating mapping in the structs-config.xml
file (with Xdoclet).

Currently, I am getting this error:

....
15:55:47,890 INFO  [PluginPackageUtil:1391] Finished checking for
available updates in 2 ms
15:55:54,284 ERROR [PortletRequestDispatcherImpl:316]
org.apache.jasper.JasperException: javax.servlet.ServletException:
javax.servlet.jsp.JspException: Cannot retrieve mapping for action
/onlinepayment_portlet/order
org.apache.jasper.JasperException: javax.servlet.ServletException:
javax.servlet.jsp.JspException: Cannot retrieve mapping for action
/onlinepayment_portlet/order
       at 
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
       at 
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
       at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
...

-- In my OrderForm.java file, I have:
package com.XYZ.onlinepayment.portlet;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

/**
 * Search query entry form.
 *
 * @struts.form name="OrderForm"
 */
....

-- In OrderAction.java file:
package com.XYZ.onlinepayment.portlet;

import java.io.IOException;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.XYZ.onlinepayment.portlet.OrderForm;

import com.liferay.portal.struts.PortletAction;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletConfig;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;


/** @struts.action name="OrderForm" path="/onlinepayment_portlet/order1"
 * scope="session"
 * input="/portlet/onlinepayment_portlet/order.jsp"
 *
 * @struts.action-forward
name="/onlinepayment_portlet/success_to_order2"
path="/onlinepayment_portlet/order2"
 */

public class OrderAction extends PortletAction{

...

-- xdoclet generated struts-config.xml file:

 <form-beans>

   <form-bean
     name="OrderForm"
     type="com.XYZ.onlinepayment.portlet.OrderForm"
   />

 </form-beans>

 <!-- ========== Action Mapping Definitions
=================================== -->
  <action-mappings>
   <action
     path="/onlinepayment_portlet/order1"
     type="com.XYZ.onlinepayment.portlet.OrderAction"
     name="OrderForm"
     scope="session"
     input="/portlet/onlinepayment_portlet/order.jsp"
     unknown="false"
     validate="true"
   >
     <forward
       name="/onlinepayment_portlet/success_to_order2"
       path="/onlinepayment_portlet/order2"
       redirect="false"
     />
   </action>

 </action-mappings>

      <message-resources parameter="resources.application"
null="true"></message-resources>
      <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
               <set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"></set-property>
      </plug-in>

-- my build.xml file:
<?xml version="1.0"?>

<project name="portlet" basedir="." default="deploy">
       <import file="../build-common-portlet.xml" />

       <target name="compile">

               <mkdir dir="docroot/WEB-INF/classes/" />
               <mkdir dir="docroot/WEB-INF/src/" />
               <path id="plugin-lib.classpath">
                       <pathelement
location="${app.server.classes.portal.dir}" />
                       <fileset dir="${app.server.lib.portal.dir}"
includes="*.jar" />
                       <pathelement location="docroot/WEB-INF/classes" />

                       <fileset dir="${env.XDOCLET_HOME}">
                       <include name="**/*.jar"/>
                       </fileset>
               </path>

               <taskdef name="webdoclet"
                       classname="xdoclet.modules.web.WebDocletTask"
                       classpathref="plugin.classpath">
               </taskdef>
               <webdoclet destdir="docroot/WEB-INF"
mergedir="metadata/web" excludedtags="@version,@author"
verbose="true">
                       <fileset dir="docroot/WEB-INF/src">
                               <include name="**/*Form.java" />
                               <include name="**/*Action.java" />
                               <include name="**/*Servlet.java" />
                       </fileset>
                       <deploymentdescriptor validatexml="true"
                               servletspec="2.3" sessiontimeout="60"
                               destdir="docroot/WEB-INF" distributable="false">
                       </deploymentdescriptor>
                       <strutsconfigxml validatexml="true" version="1.1"/>
                       <strutsvalidationxml/>
               </webdoclet>

               <javac
                       classpathref="plugin.classpath"
                       compiler="${javac.compiler}"
                       debug="${javac.debug}"
                       deprecation="${javac.deprecation}"
                       destdir="docroot/WEB-INF/classes"
                       nowarn="${javac.nowarn}"
                       srcdir="docroot/WEB-INF/src"

               />

               <antcall target="build-common-plugin.compile" />
       </target>

       <target name="build-lang">
               <antcall target="build-lang-cmd">
                       <param name="lang.dir"
value="docroot/WEB-INF/src/content/test" />
                       <param name="lang.file" value="Language" />
               </antcall>
       </target>
</project>

I know it seems messy. But I don't know how to instruct xdoclet
"automatically" generate correct mappings in struts-config.xml file.

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
xdoclet-user mailing list
xdoclet-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to